Reputation: 528
I am trying to install vue-cli 3 with the given instructions.
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 [email protected]
postinstall script
See this: child_process.spawn does not work with npm run scripts on windows github.com/nodejs/node/issues/3675
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?
here is the error:
stack Error: [email protected] 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 [email protected]
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 [email protected] postinstall script.
error This is probably not a problem with npm. There is likely additional logging output above.
Upvotes: 2
Views: 3744
Reputation: 528
I used the ignore-scripts flag
npm install @vue/cli -g --ignore-scripts
Then I did the same for protobufjs
npm install protobufjs -g --ignore-scripts
Finally i manually ran the protobufjs postinstall script
node ~/n/lib/node_modules/protobufjs/bin/scripts/postinstall.js
My installation appears to be working correctly now.
Upvotes: 2