Error installing Vue directly from git using npm
Closed this issue · 11 comments
I am trying to install Vue directly from GitHub:
npm install https://github.com/vuejs/vue.git#dev
I would expect that install succeeds like it does for:
npm install https://github.com/vuejs/vue.git#master
But I get the error:
> vue@2.3.3 postinstall /Users/user/Temp/test/node_modules/vue
> node build/install-hooks.js
module.js:471
throw err;
^
Error: Cannot find module '/Users/user/Temp/test/node_modules/vue/build/install-hooks.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
npm WARN enoent ENOENT: no such file or directory, open '/Users/user/Temp/test/package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/user/.nvm/versions/node/v6.11.0/bin/node" "/Users/user/.nvm/versions/node/v6.11.0/bin/npm" "install" "https://github.com/vuejs/vue.git#dev"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! vue@2.3.3 postinstall: `node build/install-hooks.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue@2.3.3 postinstall script 'node build/install-hooks.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vue package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/install-hooks.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vue
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vue
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/user/Temp/test/npm-debug.log
Versions:
$ npm -v
3.10.10
Current Vue dev commit is 0d6ad12.
Note: I could not use the web interface to create this issue because I could not host reproduction for this because it involves npm.
The dev branch contains the development code, it may not be stable. Why would you even install from master branch if you can install the package?
You can skip the npm postinstall script with --ignore-scripts if needed bu the main purpose of the repository is to be used as the dev environment not as a package
So that we can use a fork of the repo without publishing it. Important is that one can provide a dependency directly on this git fork inside package.json, not sure if you can define a git dependency with ignore-scripts.
If you want to install your own fork anyway, remove the postinstall.
Our repository needs that script for our development process, so we cannot remove it, obviously.
I'd suggest just removing the hook in the fork - the hook itself is necessary for enforcing workflow in the main repo. Alternatively we can take a PR that makes the hook an noop when the repo is installed via npm instead of a local development npm install.
This issue effects all npm install vue command ,not only from git directly.
npm -v
5.0.3
~/w/t/vue-pure-npm-install-bug ❯❯❯ npm install vue --save ⏎
> vue@2.4.0 postinstall ~/workspaces/testing/vue-pure-npm-install-bug/node_modules/vue
> node build/install-hooks.js
module.js:472
throw err;
^
Error: Cannot find module '~/workspaces/testing/vue-pure-npm-install-bug/node_modules/vue/build/install-hooks.js'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
npm WARN vue-pure-npm-install-bug@1.0.0 No description
npm WARN vue-pure-npm-install-bug@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue@2.4.0 postinstall: `node build/install-hooks.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue@2.4.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2017-07-13T06_28_51_157Z-debug.log
npm install vue@2.3.4 is ok.
~/w/t/vue-pure-npm-install-bug ❯❯❯ npm install vue@2.3.4 --save ⏎
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN vue-pure-npm-install-bug@1.0.0 No description
npm WARN vue-pure-npm-install-bug@1.0.0 No repository field.
+ vue@2.3.4
added 1 package in 2.809s
I can confirm that this is not working on npm. I have a fresh installation of Laravel and immediately run npm install but it outputs an error message the same as the previous comment.
Adding --ignore-scripts tag after the npm install will continue the installation without warnings/error
npm install --ignore-scripts
FYI the script has been renamed as it causes normal installs to fail as well.
Anyone have a bandage for this? Just trying to get a fresh Laravel install working.
I can just say, I told you so. :-)
I am glad this got resolved finally.