【node错误】C:\Users\mac\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
错误mac@MacbookMainWin7 MINGW64 ~$ npm i -g electron-builder electron-package+ electron-builder@22.14.13+ electron-package@0.1.0added 215 packages from 199 contributors in 30.781smac@MacbookMainWin7 MIN
·
错误
mac@MacbookMainWin7 MINGW64 ~
$ npm i -g electron-builder electron-package
+ electron-builder@22.14.13
+ electron-package@0.1.0
added 215 packages from 199 contributors in 30.781s
mac@MacbookMainWin7 MINGW64 ~
$ electron -v
C:\Users\mac\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
mac@MacbookMainWin7 MINGW64 ~
$
错误原因
无缘无故多了一个文件“node”,内容是“This file intentionally left blank”
路径是:C:\Users\mac\AppData\Roaming\npm\node_modules\node\bin
解决办法
删掉这个文件即可
C:\Users\xxxxxxxx\AppData\Roaming\npm\node_modules\node\bin\node
注意修改xxxxxxxx为你的用户名
重新运行node命令:
mac@MacbookMainWin7 MINGW64 ~ $ electron -v Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher. Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this check, but Node.js might not execute correctly. Any issues encountered on unsupported platforms will not be fixed. |
我他喵.....
看这段鸡肠的意思,要我们添加一个系统变量“NODE_SKIP_PLATFORM_CHECK”
值为1,保存,ok!再来!
不行,还是一个样,重启电脑!
再来!
ok,搞定。。。。
更多推荐
已为社区贡献46条内容
所有评论(0)