Open hyperknot opened 7 years ago
I'm able to reproduce this 100% of the time using the given dependencies simply by running rm -rf node_modules/ yarn.lock && yarn install --prod
.
I'm hitting this as well. yarn install
works fine but yarn install --production
fails.
{
"private": true,
"dependencies": {
"bootstrap-sass": "^3.3.7",
"browserify": "^13.1.1",
"gulp": "^3.9.1",
"gulp-coffee": "^2.3.2",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.3.2",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.7",
"lodash": "^4.16.1",
"run-sequence": "^1.2.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
},
"devDependencies": {
"jest-cli": "^16.0.2"
}
}
output
yarn install v0.16.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /src/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /src/node_modules/node-sass
Output:
module.js:474
throw err;
^
Error: Cannot find module 'string-width'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/src/node_modules/wide-align/align.js:2:19)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
This was closed with no solution. Is not yarn ready to use on production?
This one is still open, a linked issue was closed.
Just chiming in to say that I too ran into this with node-sass using the production flag
error /var/www/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /var/www/node_modules/node-sass
Output:
module.js:474
throw err;
^
Error: Cannot find module 'pinkie-promise'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/www/node_modules/har-validator/lib/index.js:3:15)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)", "stdout": "yarn install v0.16.1
info No lockfile found.
@iturgeon Can you provide the relevant info from your package.json
? I am going to dig deeper into this one for a solution.
Will do, trying to reduce it down at the moment. It looks like if I run yarn install --production again after it fails, well, it works.
After running it 30 or so times (clearing node_modules dir after each) the failure seems intermittent.
Heres a clipped dep/devdep list that will produce the Error: Cannot find module 'pinkie-promise'
error I listed above
{
"dependencies": {
"gulp": "^3.8.11",
"gulp-coffee": "^2.3.1",
"gulp-concat": "^2.5.2",
"gulp-minify-css": "^1.2.1",
"gulp-ng-annotate": "^0.5.2",
"gulp-sass": "^2.0.4"
},
"devDependencies": {
"gulp-livereload": "^3.8.0",
"gulp-watch": "^4.1.1"
}
}
If I delete node_modules and run "yarn install --prod" it always fails. However, if I run it a second time after the failure, it works.
We are still having this problem. The temporary solution for us was to run without the --prod
flag until the problem is solved. But with the release of 0.17.x
, yarn have started to use NODE_ENV=production
(see https://github.com/yarnpkg/yarn/blob/v0.17.0/src/cli/commands/install.js#L110) to set this option, what made our deploys to fail again.
There are any solutions to this problem yet?
Still got this problem with 0.18.1 and node-sass.
error .../node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: .../node_modules/node-sass
Output:
module.js:327
throw err;
^
Error: Cannot find module 'code-point-at'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (.../node_modules/string-width/index.js:3:19)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
The hackathon-starter project cannot be easily deployed to Heroku (for instance) because of that, with the exact same behavior.
Any update on this issue? Still failing with 0.19.1 on ubuntu
Getting this error too.
Do you want to request a feature or report a bug? bug
What is the current behavior?
--prod
mode randomly fails installingnode-sass
. How frequently depends on the JSON file.The missing package also depends on what is the contents of the JSON file (try removing random lines). It seems to be related to devDependencies being present. With no devDependencies I couldn't reproduce.
Some error messages:
If the current behavior is a bug, please provide the steps to reproduce. Try to
yarn install --prod
the following package.json:fails 1 out of 5 times:
fails 9 out of 10 times:
Generally the more packages the higher chance of failing.
What is the expected behavior? It should install the non-dev dependencies without failing.
Please mention your node.js, yarn and operating system version. node v4.6.1, yarn 0.16.1, OS X 10.11.6