Closed noraj closed 5 years ago
I figured that node_modules/node-sass/
was containing:
$ ls -1 node_modules/node-sass/
bin
binding.gyp
CHANGELOG.md
lib
LICENSE
node_modules
package.json
README.md
scripts
src
test
Where it should look like:
$ ls -1 node_modules/node-sass
bin
binding.gyp
CHANGELOG.md
lib
LICENSE
package.json
README.md
scripts
src
test
vendor
So I re-installed it:
$ sudo npm i node-sass --python="/usr/bin/python2" --unsafe-perm
> node-sass@4.6.1 install /srv/flood/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.6.1/linux-x64-57_binding.node
Download complete..] - :
Binary saved to /srv/flood/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /root/.npm/node-sass/4.6.1/linux-x64-57_binding.node
> node-sass@4.6.1 postinstall /srv/flood/node_modules/node-sass
> node scripts/build.js
Binary found at /srv/flood/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ node-sass@4.6.1
updated 2 packages in 77.044s
And now the directory seems normal:
$ ls -1 node_modules/node-sass
bin
binding.gyp
CHANGELOG.md
lib
LICENSE
node_modules
package.json
README.md
scripts
src
test
vendor
And now it works
$ sudo npm run build
> flood@1.0.0 build /srv/flood
> node client/scripts/build.js
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
396.88 KB (-521 B) assets/static/js/main.7a1176c2.js
16.21 KB assets/static/css/main.ebb9e2e6.css
Hope it can help someone.
@jfurrow by the way : flood
ask for node-sass 4.5.3+ and when reinstalling I installed node-sass last version that is 4.6.1. By seeing tags change-log I saw that 4.6.0 brought nodejs 9 support. So if we want to support nodejs 9 we need to update the package.json. See PR #534
That's why my problem was solved because I was running nodejs 8.8.1 and I checked that node-sass@4.5.3 is normally containing vendor. So that's mysterious.
Another error that can happen when having an outdated node-sass:
npm run build
> flood@1.0.0 build /srv/flood
> node client/scripts/build.js
Creating an optimized production build...
Failed to compile.
./client/src/sass/style.scss
Module build failed: Error: Missing binding /srv/flood/node_modules/node-sass/vendor/linux-x64-59/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 9.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 8.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
./client/src/sass/style.scss
Module build failed: ModuleBuildError: Module build failed: Error: Missing binding /srv/flood/node_modules/node-sass/vendor/linux-x64-59/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 9.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 8.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! flood@1.0.0 build: `node client/scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flood@1.0.0 build 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! /home/flood/.npm/_logs/2017-11-26T23_30_01_613Z-debug.log
Outdated node-sass again. #768
/root/.npm/_logs/2017-11-11T17_49_10_048Z-debug.log
: