-
Notifications
You must be signed in to change notification settings - Fork 1.5k
can not use '__static' #248
Comments
The |
@SimulatedGREG |
https://simulatedgreg.gitbooks.io/electron-vue/content/en/migration-guide.html This is a good start, but isn't a full proof method. Depending on what you may have changed in your project, there could be other items to migrate manually. |
@SimulatedGREG |
This happened because of a Related: vuejs/vue-cli#450, #240 Items such as |
i use the latest 'electron-vue' project, and when i use 'let fileContents = fs.readFileSync(path.join(__static, '/Grgzpt.exe'), 'utf8')' in the 'main/index.js',it threw an error that 'no such file or directory, open 'C:\Users\wzh-lian\Desktop\my-project\Userswzh-lianDesktopmy-projectstatic\Grgzpt.exe'' |
Not sure what you changed, but this path that was created surely doesn't look right. |
in the 'main/index.js' ,you give the code that 'if (process.env.NODE_ENV !== 'development') { |
@SimulatedGREG |
Assuming import { shell } from 'electron'
import path from 'path'
shell.openItem(path.join(__static, '/Grgzpt.exe')) |
yes,it worked.but in the latest project,when i executed the command 'npm run build:win32',it threw an err that 'Error: EPERM: operation not permitted, symlink 'C:\Users\wzh-lian\Desktop\my-project\node_modules._7zip@0.0.6@7zip' -> 'C:\Users\wzh-lian\AppData\Local\Temp |
Looking at the error you posted, it seem you are running into a permission error. Is your terminal running in Administrator mode? |
You mean that I should run the cmd as Administrator? |
Exactly that. |
i just can not understand about that,and how to build the project |
Are you able to build a blank project from a fresh and untouched |
I uesd 'vue init simulatedgreg/electron-vue my-project' to create a new project ,and then I executed the command 'npm run build:win32',it threw the same error |
Is this error related to the '7zip'? |
It looks like Unless your cmd isn't being ran as administrator, (which it should be running as administrator), I don't really know what to tell you about Other than fixing the |
when i use 'let fileContents = fs.readFileSync(path.join(__static, '/Grgzpt.exe'), 'utf8')',it threw an error that '__static is not defined'
The text was updated successfully, but these errors were encountered: