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

Run command "npm run dev“, get npm Error. #207

Open
1294549175 opened this issue Jun 7, 2023 · 2 comments
Open

Run command "npm run dev“, get npm Error. #207

1294549175 opened this issue Jun 7, 2023 · 2 comments

Comments

@1294549175
Copy link

After i try to start web service by "sudo npm run dev", i get some vue error.I paste Error Info behind.

pkuccadm@node1:/data/huwenp/cxj/JARVIS/web$ sudo npm run dev

[email protected] dev /data/huwenp/cxj/JARVIS/web
vite

/data/huwenp/cxj/JARVIS/web/node_modules/vite/bin/vite.js:2
import { performance } from 'node:perf_hooks'
^

SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: vite
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev 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! /root/.npm/_logs/2023-06-07T08_41_05_074Z-debug.log

捕获

@Zack4DEV
Copy link

you need to update "NodeJs" : curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&sudo apt-get install -y nodejs

@HassanAliRizvi
Copy link

I updated NodeJS and ran npm run dev. It didn't work even after that but running npm run dev after running the command nvm use node works. nvm use node just makes sure you are using the latest node version

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

3 participants