Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail on node-sass post-install commands #786

Closed
Grawl opened this issue Oct 12, 2016 · 27 comments
Closed

Fail on node-sass post-install commands #786

Grawl opened this issue Oct 12, 2016 · 27 comments

Comments

@Grawl
Copy link

Grawl commented Oct 12, 2016

Do you want to request a feature or report a bug?

A bug.

What is the current behavior?

Yarn cannot install node-sass package.

Log

$ yarn
yarn install v0.15.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning gulp > vinyl-fs > glob-stream > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp-buffer > through2 > xtend > [email protected]: 
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
warning browser-sync > localtunnel > request > [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
warning gulp-imagemin > imagemin-jpegtran > exec-buffer > execa > [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
[2/4] 🚚  Fetching packages...
warning [email protected]: The engine "rhino" appears to be invalid.
warning [email protected]: The engine "rhino" appears to be invalid.
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/4] ⠁ gifsicle
[2/4] ⠁ jpegtran-bin
[3/4] ⠁ optipng-bin
[4/4] ⠁ node-sass
error /Users/grawl/Sites/jew-simulator/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /Users/grawl/Sites/jew-simulator/node_modules/node-sass
Output:
module.js:457
    throw err;
    ^

Error: Cannot find module 'stringstream'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/grawl/Sites/jew-simulator/node_modules/request/request.js:15:20)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at SpawnError (/Users/grawl/.yarn/lib/errors.js:18:1)
    at ChildProcess.proc.on.code (/Users/grawl/.yarn/lib/util/child.js:107:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.
$ yarn
yarn install v0.15.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning gulp > vinyl-fs > glob-stream > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp-buffer > through2 > xtend > [email protected]: 
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
warning browser-sync > localtunnel > request > [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
warning gulp-imagemin > imagemin-jpegtran > exec-buffer > execa > [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
[2/4] 🚚  Fetching packages...
warning [email protected]: The engine "rhino" appears to be invalid.
warning [email protected]: The engine "rhino" appears to be invalid.
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/4] ⠁ gifsicle
[2/4] ⠁ jpegtran-bin
[3/4] ⠁ optipng-bin
[4/4] ⠁ node-sass
error /Users/grawl/Sites/jew-simulator/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /Users/grawl/Sites/jew-simulator/node_modules/node-sass
Output:
module.js:457
    throw err;
    ^

Error: Cannot find module 'stringstream'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/grawl/Sites/jew-simulator/node_modules/request/request.js:15:20)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at SpawnError (/Users/grawl/.yarn/lib/errors.js:18:1)
    at ChildProcess.proc.on.code (/Users/grawl/.yarn/lib/util/child.js:107:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.

If the current behavior is a bug, please provide the steps to reproduce.

  • Have a valid package.json on working project with node-sass (I tried with my Identity build system)
  • Delete node_modules if exists
  • Run yarn from shell
  • Wait

What is the expected behavior?

All packages is installed and gulp build is working.

Please mention your node.js, yarn and operating system version.

$ node -v
v6.6.0
$ yarn -v
yarn install v0.15.1

macOS Sierra Beta 10.12.1 (16B2338c)

@asciidisco
Copy link

Same here with node 4.0.0, same yarn version on macOS 10.11

@carneiror
Copy link

I have the same error (Cannot find module 'stringstream') but when installing phantomjs.

node v6.2.1
osx 10.11

@terion-name
Copy link

same

@carneiror
Copy link

Looks like a duplicate issue from #987

@Grawl
Copy link
Author

Grawl commented Oct 14, 2016

@carneiror looks like you are right

@Grawl Grawl closed this as completed Oct 14, 2016
@mike-hearn
Copy link

#987 was closed 9 days ago, but I'm still seeing this issue with node-sass and yarn 0.16.1. Here's the shell log from trying to install it in a new project. May I suggest we re-open? Or am I missing something?

$ yarn init
yarn init v0.16.1
question name (yarn_test):
question version (1.0.0):
question description:
question entry point (index.js):
question git repository:
question author:
question license (MIT):
success Saved package.json
✨  Done in 4.33s.

$ yarn add node-sass
yarn add v0.16.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/1] ⠈ node-sass
[-/1] ⠈ waiting...
[-/1] ⠈ waiting...
[-/1] ⠈ waiting...
error /private/tmp/yarn_test/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /private/tmp/yarn_test/node_modules/node-sass
Output:
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at /private/tmp/yarn_test/node_modules/node-sass/scripts/install.js:122:26
    at /private/tmp/yarn_test/node_modules/mkdirp/index.js:30:20
    at FSReqWrap.oncomplete (fs.js:111:15)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@whitetrefoil
Copy link

whitetrefoil commented Nov 3, 2016

same here like @mike-hearn

Haven't look into it carefully, just guess maybe because that script depends on process.env.npm_config_sass_binary_cache and process.env.npm_config_cache?

that error came from path.join(sass.getCachePath(), pkg.name, pkg.version); while

function getCachePath() {
  return process.env.npm_config_sass_binary_cache ||
         process.env.npm_config_cache;
}

@Grawl
Copy link
Author

Grawl commented Nov 3, 2016

@mike-hearn @whitetrefoil so should I reopen this issue to indicate that the problem still exists?

@anton-kasperovich
Copy link

anton-kasperovich commented Nov 3, 2016

Have the same issue and what most interesting part is that i didn't change anything in package.json of a project, but "yesterday" everything worked just fine and "today" i have this error:

[4/4] Building fresh packages...
�[91merror /code/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /code/node_modules/node-sass
Output:
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1213:7)
    at /code/node_modules/node-sass/scripts/install.js:122:26
    at /code/node_modules/mkdirp/index.js:30:20
    at FSReqWrap.oncomplete (fs.js:123:15)

@Grawl Grawl reopened this Nov 3, 2016
@whitetrefoil
Copy link

It seems that getCachePath() code was added recently.

I tried to workaround it by adding sass_binary_cache=/home/my_user/.node-sass into ~/.npmrc and it seemed to be successful.

@zhu-meng-han
Copy link

same @mike-hearn
Just before I installed node-sass

yarn add node-sass
node -v
6.2.1

yarn add v0.16.1
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning Incorrect peer dependency "css-loader@^0.24.0".
warning Unmet peer dependency "postcss@^5.1.0".
warning Incorrect peer dependency "postcss-loader@^0.11.1".
[4/4] 📃 Building fresh packages...
[-/3] ⠈ waiting...
[2/3] ⠈ node-sass
[3/3] ⠈ node-sass
[-/3] ⠈ waiting...
error /Users/zhumenghan/eleme-work/eleme/im_fe_cs/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /Users/zhumenghan/eleme-work/eleme/im_fe_cs/node_modules/node-sass
Output:
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^

TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1213:7)
at /Users/zhumenghan/eleme-work/eleme/im_fe_cs/node_modules/node-sass/scripts/install.js:122:26
at /Users/zhumenghan/eleme-work/eleme/im_fe_cs/node_modules/mkdirp/index.js:30:20
at FSReqWrap.oncomplete (fs.js:117:15)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@pokidovea
Copy link

The same problem

@PaddyMann
Copy link

Downgrading to [email protected] works for me today.

@dopesong
Copy link

Same problem here. Downgrade helped

@torifat
Copy link
Member

torifat commented Nov 23, 2016

@dopesong can you try yarn add --force node-sass using yarn v0.17.8

@busches
Copy link
Contributor

busches commented Dec 1, 2016

Can you retest with yarn@latest? Yarn v0.17.10 is installing node-sass successfully with yarn add node-sass.

@ShaharHD
Copy link

ShaharHD commented Feb 6, 2017

Still an issue with Yarn v0.19.1 on heroku install

Error: Cannot find module 'code-point-at'

@orlin
Copy link

orlin commented Feb 16, 2017

I was getting the same with yarn v0.19.1 and node v6.9.4 on osx. I thought about adding a preinstall npm i node-sass --no-bin-links. However I just upgraded yarn to v0.20.3 and it seems to install fine as well.

@doytch
Copy link

doytch commented Apr 5, 2017

Getting this issue on Ubuntu 14.04 w/ node 7.7.3 (and various older 7.x nodes) but only with a locally-installed copy of yarn (i.e., npm install yarn). If I run a globally-installed copy instead, it works correctly.

Trouble is, the machines at work have old (and unchangeable) copies of Node so I have to run a fetch-nvm-and-node script before running yarn, and I don't want the builds to require human interaction to enter a sudo password to globally install yarn.

Here's my own output:

yarn install v0.21.3
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠂ node-sass
[-/1] ⠂ waiting...
[-/1] ⠄ waiting...
[-/1] ⠄ waiting...
[-/1] ⠄ waiting...

------ it stalls here forever, so I Ctrl+C and .... ------

Error: Cannot find module '../errors.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at _load_errors (/local/mnt/work/seras/web/node_modules/yarn/lib/cli/index.js:42:20)
    at config.init.then.catch.err (/local/mnt/work/seras/web/node_modules/yarn/lib/cli/index.js:456:34)

@EvanLovely
Copy link

I'm able to get around this by having npm rebuild node-sass in my postinstall script in package.json.

@AlejandroHuerta
Copy link

AlejandroHuerta commented May 20, 2017

I'm having issues with this where a dependency has a postinstall script that requires node-sass. Adding "postinstall": "npm rebuild node-sass" in my package doesn't solve this for me. This is with Yarn v0.24.5

@bestander
Copy link
Member

@AlejandroHuerta, can you share the steps to reproduce your issue?

@luisfpg
Copy link

luisfpg commented Jun 26, 2017

I've got another insight on this one:
If the node-sass package is not installed and one runs "npm update" this error triggers.
Tested with Node v8.1.2 and NPM v5.0.3.

@bherila
Copy link

bherila commented Sep 5, 2017

@bestander here is a simple repro:

git clone https://github.com/barbar/vortigern.git
yarn install

then npm rebuild node-sass will fail. This problem does not happen when installing the packages with npm.

@BYK
Copy link
Member

BYK commented Sep 15, 2017

This seems to be fixed with Yarn 1.0+. Can someone confirm? @bherila I wasn't able to reproduce the issue with the steps you provided on latest master. If Yarn 1.0.2 still doesn't work for you, would you mind trying one of the nightlies from https://yarnpkg.com/en/docs/nightly

@thomasmattheussen
Copy link

Yarn 1.0.2 didn't work for me, but the current nightly build (1.0.2-20170922.1215) solved this issue for me.

@BYK BYK closed this as completed Sep 22, 2017
@TomYule
Copy link

TomYule commented Oct 20, 2017

npm install node-sass --sass-binary-site=https://npm.taobao.org/mirrors/node-sass/

kidd added a commit to metabase/metabase that referenced this issue Mar 7, 2021
* To be able to run a devcontainer its own network (not just --net
host), webpack-dev-server serves on 0.0.0.0.
* Fix expired signature (EXPKEYSIG):
  yarnpkg/yarn#786
kidd added a commit to metabase/metabase that referenced this issue Mar 8, 2021
* To be able to run a devcontainer its own network (not just --net
host), webpack-dev-server serves on 0.0.0.0.
* Fix expired signature (EXPKEYSIG):
  yarnpkg/yarn#786
kidd added a commit to metabase/metabase that referenced this issue Mar 8, 2021
* To be able to run a devcontainer its own network (not just --net
host), webpack-dev-server serves on 0.0.0.0.
* Fix expired signature (EXPKEYSIG):
  yarnpkg/yarn#786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests