npm ci command throws error in client directory

4775
12
Jump to solution
12-12-2023 11:21 AM
JaredPilbeam2
MVP Regular Contributor

Currently I'm running Node.js v. 18.18.2 as suggested in this post with ExB v. 1.13. The command npm ci runs without error in the server directory. It errors in the client directory. I've already tried with the latest Node.js v. 20.1.0. No difference.  

C:\WINDOWS\system32>cd C:\ArcGISExperienceBuilder\client

C:\ArcGISExperienceBuilder\client>npm ci
npm ERR! code EUSAGE
npm ERR!
npm ERR! The `npm ci` command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm ERR! [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
npm ERR! [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run "npm help ci" for more info

 

It was suggested in my earlier post  to run these commands, but they make no difference.

//Turns off ssl
npm set strict-ssl false
//Installs node packages
npm ci
//Turns ssl back on for future protection
npm set strict-ssl true

 

During this attempted installation of Node.js I checked the Chocolatey box when installing as suggested by an ESRI tech over the phone. I guess I can uninstall then reinstall leaving that unchecked. The guide pretty much leaves you hanging here.

1 Solution

Accepted Solutions
JaredPilbeam2
MVP Regular Contributor

It ended up being in right in front of me. I'm used to debugging Python not Node.js, either way it helps to read the errors closely. What we were calling the "python" error was in fact the apparently out-dated node-sass module.

The first three lines of the error show this:

 

npm ERR! code 1
npm ERR! path C:\Users\jpfal\Desktop\ArcGISExperienceBuilder\client\node_modules\node-sass
npm ERR! command failed

 

So, I found some help online and removed the old node-sass and replaced it with the sass module from within the client directory: ArcGISExperienceBuilder\client

 

npm uninstall node-sass
npm install sass --save-dev

 

 

 

 

View solution in original post

12 Replies
JeffreyThompson2
MVP Regular Contributor

Are you running your console in Admin mode?

Does your client folder contain a file called package-lock.json? This file should be pretty big ~50,000 lines long. It is the instructions for what npm should install.

GIS Developer
City of Arlington, Texas
0 Kudos
JaredPilbeam2
MVP Regular Contributor

Thanks for the response. Yes, I'm running in Admin mode. 

No, package-lock.json is missing from the client folder. I was also attempting to decipher this, but no luck so far. 

 

npm ERR! The `npm ci` command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.

 

Edit: I just copy/pasted the package-lock.json file but that resulted in tons of missing components.

 

0 Kudos
JeffreyThompson2
MVP Regular Contributor

If your missing that file, something must have gone wrong in the downloading or un-zipping process. Try starting over with a new download. npm can't do its job without that file.

GIS Developer
City of Arlington, Texas
0 Kudos
JaredPilbeam2
MVP Regular Contributor

I will do that, thanks. Out of curiosity, what are the other two downloads for? I've actually downloaded them once before when on the phone with an analyst, but we both weren't sure what they did.

JaredPilbeam2_0-1702411324584.png

 

0 Kudos
JaredPilbeam2
MVP Regular Contributor

I did a new install of ExB v. 1.13. I can confirm that the package-lock.json file (along with many others that weren't there before) is now in the client folder. I ran npm ci from the admin prompt. New errors:

 

C:\ArcGISExperienceBuilder\client>npm ci
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-popper@1.3.11
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.2.0" from the root project
npm WARN   37 more (@emotion/react, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" from react-popper@1.3.11
npm WARN node_modules/reactstrap/node_modules/react-popper
npm WARN   react-popper@"^1.3.6" from reactstrap@8.10.1
npm WARN   node_modules/reactstrap
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" from react-popper@1.3.11
npm WARN   node_modules/reactstrap/node_modules/react-popper
npm WARN     react-popper@"^1.3.6" from reactstrap@8.10.1
npm WARN     node_modules/reactstrap
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\ArcGISExperienceBuilder\\client\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\ArcGISExperienceBuilder\client\node_modules\@arcgis\core\views'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\ArcGISExperienceBuilder\\client\\node_modules\\@arcgis\\core\\views'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\ArcGISExperienceBuilder\client\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\ArcGISExperienceBuilder\client\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\ArcGISExperienceBuilder\\client\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@18.18.2 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Python312\python.exe"
npm ERR! gyp verb find Python - executing "C:\Python312\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.12.1"
npm ERR! gyp info find Python using Python version 3.12.1 found at "C:\Python312\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 18.18.2
npm ERR! gyp verb command install [ '18.18.2' ]
npm ERR! gyp verb install input version string "18.18.2"
npm ERR! gyp verb install installing version: 18.18.2
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version not already installed, continuing with install 18.18.2
npm ERR! gyp verb ensuring nodedir is created C:\Users\jpilbeam\AppData\Local\node-gyp\Cache\18.18.2
npm ERR! gyp verb created nodedir C:\Users\jpilbeam\AppData\Local\node-gyp\Cache\18.18.2
npm ERR! gyp http GET https://nodejs.org/download/release/v18.18.2/node-v18.18.2-headers.tar.gz
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp verb command remove [ '18.18.2' ]
npm ERR! gyp verb remove using node-gyp dir: C:\Users\jpilbeam\AppData\Local\node-gyp\Cache
npm ERR! gyp verb remove removing target version: 18.18.2
npm ERR! gyp verb remove removing development files for version: 18.18.2
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.18.2/node-v18.18.2-headers.tar.gz failed, reason: self-signed certificate in certificate chain
npm ERR! gyp ERR! stack     at ClientRequest.<anonymous> (C:\ArcGISExperienceBuilder\client\node_modules\node-sass\node_modules\node-gyp\node_modules\minipass-fetch\lib\index.js:110:14)
npm ERR! gyp ERR! stack     at ClientRequest.emit (node:events:517:28)
npm ERR! gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:501:9)
npm ERR! gyp ERR! stack     at TLSSocket.emit (node:events:529:35)
npm ERR! gyp ERR! stack     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR! gyp ERR! stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\ArcGISExperienceBuilder\\client\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\ArcGISExperienceBuilder\client\node_modules\node-sass
npm ERR! gyp ERR! node -v v18.18.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in: C:\Users\jpilbeam\AppData\Local\npm-cache\_logs\2023-12-12T20_24_42_875Z-debug-0.log

 

I turned the ssl off then ran it again. No difference.

0 Kudos
JeffreyThompson2
MVP Regular Contributor

Did you remember to run as an Admin? The not permitted error suggests that you may have missed that step.

I was just installing Experience Builder for one of our users while you were posting and we also hit the Python error. We uninstalled Node 20.1 and installed Node 18.16. Then ran the command to turn off ssl, npm ci on the server and npm ci on the client. It worked for us.

GIS Developer
City of Arlington, Texas
JaredPilbeam2
MVP Regular Contributor

I installed Node 18.16.0 with the latest ExB. Yes, I always run as Admin. Then I turned off ssl. Same python error in client folder. I'm attempting to escalate my case to see if someone who works on this can look at my issue.

C:\WINDOWS\system32>cd C:\ArcGISExperienceBuilder\client

C:\ArcGISExperienceBuilder\client>npm set strict-ssl false

C:\ArcGISExperienceBuilder\client>npm ci
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-popper@1.3.11
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.2.0" from the root project
npm WARN   37 more (@emotion/react, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" from react-popper@1.3.11
npm WARN node_modules/reactstrap/node_modules/react-popper
npm WARN   react-popper@"^1.3.6" from reactstrap@8.10.1
npm WARN   node_modules/reactstrap
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" from react-popper@1.3.11
npm WARN   node_modules/reactstrap/node_modules/react-popper
npm WARN     react-popper@"^1.3.6" from reactstrap@8.10.1
npm WARN     node_modules/reactstrap
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path C:\ArcGISExperienceBuilder\client\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files (x86)\nodejs\node.exe C:\ArcGISExperienceBuilder\client\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files (x86)\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\ArcGISExperienceBuilder\\client\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@18.16.0 | win32 | ia32
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Python312\python.exe"
npm ERR! gyp verb find Python - executing "C:\Python312\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.12.1"
npm ERR! gyp info find Python using Python version 3.12.1 found at "C:\Python312\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 18.16.0
npm ERR! gyp verb command install [ '18.16.0' ]
npm ERR! gyp verb install input version string "18.16.0"
npm ERR! gyp verb install installing version: 18.16.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version not already installed, continuing with install 18.16.0
npm ERR! gyp verb ensuring nodedir is created C:\Users\jpilbeam\AppData\Local\node-gyp\Cache\18.16.0
npm ERR! gyp verb created nodedir C:\Users\jpilbeam\AppData\Local\node-gyp\Cache\18.16.0
npm ERR! gyp http GET https://nodejs.org/download/release/v18.16.0/node-v18.16.0-headers.tar.gz
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp verb command remove [ '18.16.0' ]
npm ERR! gyp verb remove using node-gyp dir: C:\Users\jpilbeam\AppData\Local\node-gyp\Cache
npm ERR! gyp verb remove removing target version: 18.16.0
npm ERR! gyp verb remove removing development files for version: 18.16.0
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.16.0/node-v18.16.0-headers.tar.gz failed, reason: self-signed certificate in certificate chain
npm ERR! gyp ERR! stack     at ClientRequest.<anonymous> (C:\ArcGISExperienceBuilder\client\node_modules\node-sass\node_modules\node-gyp\node_modules\minipass-fetch\lib\index.js:110:14)
npm ERR! gyp ERR! stack     at ClientRequest.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:502:9)
npm ERR! gyp ERR! stack     at TLSSocket.emit (node:events:525:35)
npm ERR! gyp ERR! stack     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR! gyp ERR! stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\ArcGISExperienceBuilder\\client\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\ArcGISExperienceBuilder\client\node_modules\node-sass
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jpilbeam\AppData\Local\npm-cache\_logs\2023-12-13T14_42_41_611Z-debug-0.log

 

0 Kudos
JeffreyThompson2
MVP Regular Contributor

The node cache are all dependencies that you are trying to install with npm ci. They are provided so you could potentially do an offline installation.

I think the other package is just a copy of the Experience Builder documentation website.

GIS Developer
City of Arlington, Texas
0 Kudos
JaredPilbeam2
MVP Regular Contributor

It ended up being in right in front of me. I'm used to debugging Python not Node.js, either way it helps to read the errors closely. What we were calling the "python" error was in fact the apparently out-dated node-sass module.

The first three lines of the error show this:

 

npm ERR! code 1
npm ERR! path C:\Users\jpfal\Desktop\ArcGISExperienceBuilder\client\node_modules\node-sass
npm ERR! command failed

 

So, I found some help online and removed the old node-sass and replaced it with the sass module from within the client directory: ArcGISExperienceBuilder\client

 

npm uninstall node-sass
npm install sass --save-dev