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

After npm install, npm run serve fails #80

Open
bbrudnoy opened this issue May 1, 2019 · 7 comments
Open

After npm install, npm run serve fails #80

bbrudnoy opened this issue May 1, 2019 · 7 comments

Comments

@bbrudnoy
Copy link

bbrudnoy commented May 1, 2019

I'm unable to run this demo as part of the Offline Web Applications course on Udacity. After npm install, npm run serve fails:

$ npm run serve

> wittr@1.0.0 serve /Users/bbrudnoy/Repositories/wittr
> gulp serve

fs.js:27
const { Math, Object, Reflect } = primordials;
                                  ^

ReferenceError: primordials is not defined
    at fs.js:27:35
    at req_ (/Users/bbrudnoy/Repositories/wittr/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/Users/bbrudnoy/Repositories/wittr/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/Users/bbrudnoy/Repositories/wittr/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wittr@1.0.0 serve: `gulp serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the wittr@1.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I'm running this on macOS Mojave (v10.14.4).

@castillo-media
Copy link

I am having the exact same problem :(
Have not found a way around it.

@israelfaria
Copy link

israelfaria commented Nov 1, 2019

I have also hit the same issue. When you dig a little deeper there's a dependency mentioned, "natives", is screaming that it will stop working on future versions of node. I wasn't sure which version was stable when this demo project was created and then tried latests patches from 8, 10 and 12 series. It seems that 10 was the last one to work with this.

Just run this project with node 10.17.0 and you'll be fine. Now I can go back to udacity videos to follow along.

👍

To check the deprecation notice try this:
npm show natives

@khwilo
Copy link

khwilo commented Nov 26, 2019

Thank you @israelfaria. Your solution has worked for me.

@marlisa31
Copy link

Thanks a lot for that hint @israelfaria! Running it with node 10.17.0 was what made it work for me too.

@ebdonato
Copy link

Does not it have another solution yet? I am using Node for some other projects and may rollback to Node 10 is a problem.

@rbicker
Copy link

rbicker commented May 13, 2021

Hi

Another solution would be running it in docker if you don't want to locally install node 10.

cd /path/to/wittr
docker run -it --rm -v $(pwd):/usr/local/src/app -p 8888:8888 -p 8889:8889 node:10 bash
# inside container / bash shell:
cd /usr/local/src/app
npm install
npm run serve

@d0rf47
Copy link

d0rf47 commented Oct 19, 2021

if you wish to run the project with "node": "^10.17.0" WITHOUT rolling back you global node version you can add node as a dev-dependency to the package.json and then run npm install. then you will likely see an error which will instruct you to run npm rebuild node-sass simply run that command and then you should be able to run npm run serve and view the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants