简体   繁体   English

vue-cli npm安装错误。 ELIFECYCLE ENOENT产生protobufjs

[英]vue-cli npm install error. ELIFECYCLE ENOENT spawn protobufjs

I am trying to install vue-cli 3 with the given instructions. 我正在尝试按照给定的说明安装vue-cli 3

   npm install -g @vue/cli

Environment: 环境:

WSL
Ubuntu 18
Node 8.12.0
npm 6.4.1
"n" node version manager

It appears the problem is node's child_process.spawn which is used by the protobufjs@6.8.8 postinstall script 看来问题出在protobufjs@6.8.8 安装后脚本使用的节点的child_process.spawn

See this: child_process.spawn does not work with npm run scripts on windows github.com/nodejs/node/issues/3675 看到这个: child_process.spawn不适用于Windows github.com/nodejs/node/issues/3675上的npm运行脚本

QUESTION is there a way to prevent that postinstal script from running and allowing the rest of the installation and I can somehow run postinstall manually later? 问题是否有一种方法可以阻止该postinstal脚本运行并允许其余安装,而我可以稍后以某种方式手动运行postinstall?

here is the error: 这是错误:

stack Error: protobufjs@6.8.8 postinstall: `node scripts/postinstall`
stack spawn ENOENT
stack     at ChildProcess.<anonymous> (/root/n/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
stack     at emitTwo (events.js:126:13)
stack     at ChildProcess.emit (events.js:214:7)
stack     at maybeClose (internal/child_process.js:915:16)
stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
pkgid protobufjs@6.8.8
cwd /mnt/c/Users/dogbot
Linux 4.4.0-17134-Microsoft
argv "/root/n/bin/node" "/root/n/bin/npm" "install" "-g" "@vue/cli"
node v8.12.0
npm  v6.4.1
@6.8.8 postinstall: `node scripts/postinstall`
error spawn ENOENT
error Failed at the protobufjs@6.8.8 postinstall script.
error This is probably not a problem with npm. There is likely additional logging output above.

I used the ignore-scripts flag 我使用了ignore-scripts标志

npm install  @vue/cli -g --ignore-scripts

Then I did the same for protobufjs 然后我对protobufjs做同样的事情

npm install protobufjs  -g --ignore-scripts

Finally i manually ran the protobufjs postinstall script 最后,我手动运行了protobufjs安装后脚本

node ~/n/lib/node_modules/protobufjs/bin/scripts/postinstall.js

My installation appears to be working correctly now. 我的安装现在似乎可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM