'Unable to npm run dev
I just want to get this React app going?? using -> npm run dev
Error:
npm run dev
> [email protected] dev
> cross-env NODE_ENV=development npm-run-all -p api client:dev server:dev styles:w
> [email protected] styles:w
> npm run styles && node-sass src/styles/styles.scss -o static/ -w src/styles --watch --recursive
> [email protected] client:dev
> webpack-dev-server --config ./build/webpack.config.js
> [email protected] server:dev
> nodemon --config nodemon.json index.js
> [email protected] api
> nodemon -x node -r @std/esm ./db/run.js
[nodemon] 1.12.5
[nodemon] 1.12.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] to restart at any time, enter `rs`
[nodemon] starting `node index.js`
[nodemon] watching: *.*
[nodemon] starting `node -r @std/esm ./db/run.js`
> [email protected] styles
> node-sass -q src/styles/styles.scss -o static/
node[42883]: ../src/node_file.cc:1038:void node::fs::Stat(const FunctionCallbackInfo<v8::Value> &): Assertion `(argc) == (4)' failed.
1: 0x102422a25 node::Abort() (.cold.1) [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
2: 0x1011180f9 node::Abort() [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
3: 0x101117f31 node::Assert(node::AssertionInfo const&) [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
4: 0x101126bb4 node::fs::Stat(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
5: 0x1013021b9 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
6: 0x101301c86 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
7: 0x1013013ff v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
8: 0x101b748f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
9: 0x101b072ea Builtins_InterpreterEntryTrampoline [/Users/Zouhir/.nvm/versions/node/v16.14.0/bin/node]
10: 0x107d9f204
[nodemon] app crashed - waiting for file changes before starting...
/Users/Zouhir/Documents/REACT/letters-social/node_modules/node-sass/lib/binding.js:13
throw new Error(errors.unsupportedEnvironment());
^
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (/Users/Zouhir/Documents/REACT/letters-social/node_modules/node-sass/lib/binding.js:13:13)
package.json
...
"scripts": {
"analyze": "cross-env ANALYZE=true npm run build",
"api": "nodemon -x node -r @std/esm ./db/run.js",
"build:app": "cross-env NODE_ENV=production webpack -p --progress --config ./build/webpack.config.prod.js",
"build": "cross-env NODE_ENV=production npm-run-all build:app db:seed",
"client:dev": "webpack-dev-server --config ./build/webpack.config.js",
"doc": "esdoc -c esdoc.json",
"db:seed": "node -r @std/esm db/seed.js",
"deploy": "now -e LETTERS_FIREBASE_ADMIN_KEY=${LETTERS_FIREBASE_ADMIN_KEY} -d",
"dev": "cross-env NODE_ENV=development npm-run-all -p api client:dev server:dev styles:w",
"server:dev": "nodemon --config nodemon.json index.js",
"start": "cross-env NODE_ENV=production pm2 start ./index.js --no-daemon",
"styles:w": "npm run styles && node-sass src/styles/styles.scss -o static/ -w src/styles --watch --recursive",
"styles": "node-sass -q src/styles/styles.scss -o static/",
"test:w": "jest --watch --coverage",
"test": "jest --coverage"
},
...
"dependencies": {
...
"node-sass": "^4.7.2",
node version:
v16.14.0
npm version:
8.3.1
I tried all these node versions:
v8.0.0
v8.17.0
v10.24.1
v11.0.0
v14.15.0
-> v16.14.0
v17.7.0
and also different node-sass package version also
4.7.2
... (forgot)
also tried
npm rebuild node-sass (something like that can't remember)
directory: directory
Thanks for the help
Solution 1:[1]
- install / downgrade node.js to a stable version (LTS) like 14.15.0
- install the compatible node-sass version via npm install [email protected]; you can find the list here, or even install gulp-sasswith npm i gulp-sass --save-dev.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mohammad hosseini |
