EmbedAI
EmbedAI copied to clipboard
unable to run npm run dev
C:>cd C:\Users\User\Documents\Learning\privateGPT2\privateGPT-main\client
C:\Users\User\Documents\Learning\privateGPT2\privateGPT-main\client>npm run dev
[email protected] dev C:\Users\User\Documents\Learning\privateGPT2\privateGPT-main\client next dev
C:\Users\User\Documents\Learning\privateGPT2\privateGPT-main\client\node_modules\next\dist\cli\next-dev.js:256 showAll: args["--show-all"] ?? false, ^
SyntaxError: Unexpected token '?'
at Module._compile (internal/modules/cjs/loader.js:892:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.dev (C:\Users\User\Documents\Learning\privateGPT2\privateGPT-main\client\node_modules\next\dist\lib\commands.js:15:30)
at Object.next dev
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! C:\Users\User\AppData\Roaming\npm-cache_logs\2023-05-29T07_17_34_828Z-debug.log
C:\Users\User\Documents\Learning\privateGPT2\privateGPT-main\client>
Please check if you have installed node and npm
can not run the client, SyntaxError: Unexpected token '??=' at cjs/loader.js
npm is the wrong version.
npm -v
will give you the version number.
Here is my build script.
apt update -y
apt install -y curl
curl -sL https://deb.nodesource.com/setup_18.x | bash -
apt install -y git nodejs python3 curl build-essential
curl https://bootstrap.pypa.io/get-pip.py | python3
cd /root
git clone https://github.com/SamurAIGPT/privateGPT.git
cd privateGPT/client
npm install
cd /root
cd privateGPT/server
pip3 install -r requirements.txt
@RattyDAVE Thanks for sharing
@cyonghui81 @Crushdada Please update your npm version
No problem. I had the same battle myself.
I am getting a similar issue, but my npm is fully up to date and I tried following the build script above.
[email protected] dev next dev
/root/privateGPT/client/node_modules/next/dist/cli/next-dev.js:256 showAll: args["--show-all"] ?? false, ^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.dev (/root/privateGPT/client/node_modules/next/dist/lib/commands.js:15:30)
at Object.
I had that too.
curl -sL https://deb.nodesource.com/setup_18.x | bash -
Solved it.
Here are my versions that work.
root@79fe99adb8e1:/# pip -V
pip 23.1.2 from /usr/local/lib/python3.10/dist-packages/pip (python 3.10)
root@79fe99adb8e1:/# npm -v
9.5.1
@YoeJates Looks like a common issue https://stackoverflow.com/questions/74707066/nextjs-unexpected-token
You need to update nvm
Closing due to inactivity