[DWC 3.4.0] NPM Error
-
@oozebot To be honest I build the DWC packages on an updated NodeJS/npm setup (Win+Linux x64, Node.js v16.13.0 and npm v8.5.5 or newer) and not on a Pi because that takes forever. Nevertheless I tried it on a stock DuetPi setup and I stumbled upon a different error, probably because Debian Buster, which the current DuetPi is based on, appears to be too outdated:
pi@duet3:~/DuetWebControl $ npm install npm WARN npm npm does not support Node.js v10.24.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/ npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! npm ERR! code EUNSUPPORTEDPROTOCOL npm ERR! Unsupported URL Type "npm:": npm:vue-loader@16.8.3 npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2022-03-28T20_31_20_219Z-debug.log
I'd update our stock image with our new Bullseye-based candidate but we're still seeing DSI/HDMI display glitches on boot so I'd like to see that resolved by an external fix before we actually deploy that for production.
Anyway, I used one of my machines where I had already installed our experimental Bullseye-based image and it worked as expected there (note that
npm run build
requires a lot of memory, 2GB were insufficient):pi@Ender3Pro ~> git clone https://github.com/Duet3D/DuetWebControl.git Cloning into 'DuetWebControl'... remote: Enumerating objects: 7323, done. remote: Counting objects: 100% (2249/2249), done. remote: Compressing objects: 100% (847/847), done. remote: Total 7323 (delta 1581), reused 1966 (delta 1388), pack-reused 5074 Receiving objects: 100% (7323/7323), 32.22 MiB | 9.72 MiB/s, done. Resolving deltas: 100% (5053/5053), done. pi@Ender3Pro ~> cd DuetWebControl/ pi@Ender3Pro ~/DuetWebControl (master)> npm install npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates. npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address' npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi' npm WARN deprecated core-js@2.6.12: core-js@<3.4 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. Please, upgrade your dependencies to the actual version of core-js. added 1600 packages, and audited 1601 packages in 2m 104 packages are looking for funding run `npm fund` for details 21 vulnerabilities (9 moderate, 12 high) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. pi@Ender3Pro ~/DuetWebControl (master)> npm run build > duetwebcontrol@3.4.0 build > vue-cli-service build ⠧ Building for production... DONE Compiled successfully in 460148ms 23:37:45 File Size Gzipped dist/js/app.0e96841f.js 2557.52 KiB 554.28 KiB dist/js/HeightMap.331065f1.js 2289.88 KiB 477.54 KiB dist/js/GCodeViewer.eecf9a52.js 1996.11 KiB 424.19 KiB dist/js/OnScreenKeyboard.f252fe41.js 97.94 KiB 31.16 KiB dist/js/ObjectModelBrowser.99d910e7.js 30.62 KiB 7.73 KiB dist/js/Accelerometer.512dbef8.js 23.80 KiB 6.31 KiB dist/precache-manifest.85a489d70beb4f0f5dc88df5e2dcbe26.js 1.88 KiB 0.62 KiB dist/service-worker.js 1.04 KiB 0.61 KiB dist/css/app.2193c7cd.css 798.55 KiB 107.88 KiB dist/css/GCodeViewer.8f3e1e94.css 16.83 KiB 2.93 KiB dist/css/ObjectModelBrowser.e4fb6f45.css 6.63 KiB 1.10 KiB dist/css/OnScreenKeyboard.74dd3124.css 4.58 KiB 1.23 KiB dist/css/HeightMap.ab31c0ef.css 0.55 KiB 0.26 KiB dist/css/Accelerometer.aaf62bb7.css 0.11 KiB 0.10 KiB Images and other types of assets omitted. DONE Build complete. The dist directory is ready to be deployed. INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
Again, please don't worry about the mentioned vulnerabilities, they aren't part of the final build.
npm audit --only prod
confirms this:pi@Ender3Pro ~/DuetWebControl (master)> npm audit --only prod found 0 vulnerabilities
-
@chrishamm thanks for this. Yes, it is a bit slow on the RPi, but manageable and I can directly run it from one of our control panels. My dev system has 8gb of ram specifically to get around the amount of memory it takes to compile.
I’ll retry tomorrow morning following your example and see if I have better luck. Both the new and old image can run 3.3 without issue so it’s something different about 3.4.
-
@chrishamm Thanks for the assist on this. I was able to get it up and running on my build machine using the original image. The following is what appears to have properly updated NPM to get it working (even though it already reported it was v8.5.5 prior to running it).
npm install -g npm@latest
-
@chrishamm - bumping this as I updated NPM when compiling 3.4.4 and now am getting the following.. Can you let me know the expected version of NPM and NodeJS to compile 3.4.4? I've tried several versions of NPM now and can't seem to get past this error.
Thanks in advance for any nudge you can provide before I wipe this install and just start over! lol
pi@owc:~/Duet3D/DWC/3.4.4 $ sudo npm run serve > duetwebcontrol@3.4.4 serve > vue-cli-service serve INFO Starting development server... ERROR ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration.optimization has an unknown property 'occurrenceOrder'. These properties are valid: object { checkWasmTypes?, chunkIds?, concatenateModules?, emitOnErrors?, flagIncludedChunks?, innerGraph?, mangleExports?, mangleWasmImports?, mergeDuplicateChunks?, minimize?, minimizer?, moduleIds?, noEmitOnErrors?, nodeEnv?, portableRecords?, providedExports?, realContentHash?, removeAvailableModules?, removeEmptyChunks?, runtimeChunk?, sideEffects?, splitChunks?, usedExports? } -> Enables/Disables integrated optimizations. Did you mean optimization.chunkIds: "size" and optimization.moduleIds: "size" (BREAKING CHANGE since webpack 5)? ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration.optimization has an unknown property 'occurrenceOrder'. These properties are valid: object { checkWasmTypes?, chunkIds?, concatenateModules?, emitOnErrors?, flagIncludedChunks?, innerGraph?, mangleExports?, mangleWasmImports?, mergeDuplicateChunks?, minimize?, minimizer?, moduleIds?, noEmitOnErrors?, nodeEnv?, portableRecords?, providedExports?, realContentHash?, removeAvailableModules?, removeEmptyChunks?, runtimeChunk?, sideEffects?, splitChunks?, usedExports? } -> Enables/Disables integrated optimizations. Did you mean optimization.chunkIds: "size" and optimization.moduleIds: "size" (BREAKING CHANGE since webpack 5)? at validate (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/node_modules/schema-utils/dist/validate.js:105:11) at validateSchema (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/validateSchema.js:78:2) at create (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/webpack.js:111:24) at webpack (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/webpack.js:158:32) at f (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/index.js:64:16) at serve (/home/pi/Duet3D/DWC/3.4.4/node_modules/@vue/cli-service/lib/commands/serve.js:185:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) pi@owc:~/Duet3D/DWC/3.4.4 $ npm --version 9.1.0 pi@owc:~/Duet3D/DWC/3.4.4 $ node --version v18.12.0
-
@oozeBot In general just the latest one. Maybe you merged the latest version but forgot to run
npm install
beforenpm run serve
? I just cloned the DWC repo again, rannpm install
, andnpm run serve
brought it up as expected.Btw, it isn't recommended to run the dev setup as root,
npm run serve
withoutsudo
should work as well. You may need to delete the node_modules folder and runnpm install
again before being able to run it as the regular user. -
@chrishamm Thanks! Didn't realize it doesn't require sudo..
FYI - I was able to get past my error by manually deleting Node.js and all node_modules, then installing version 16. Anything newer gave errors (even when manually cleaning up). FYI - here is the error I gave up at with 18.12.0 LTS. Found quite a bit of info saying this openssl issue was present in versions newer than 16.
npm run serve > duetwebcontrol@3.4.4 serve > vue-cli-service serve INFO Starting development server... 10% building 2/5 modules 3 active ...13-0!/home/pi/Duet3D/DWC/3.4.4/node_modules/babel-loader/lib/index.js!/home/pi/Duet3D/DWC/3.4.4/node_modules/eslint-loader/index.js??ref--14-0!/home/pi/Duet3D/DWC/3.4.4/src/main.jsError: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:471:10) at /home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:503:5 at /home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:358:12 at /home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at iterateNormalLoaders (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:221:10) at /home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:236:3 at runSyncOrAsync (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:130:11) at iterateNormalLoaders (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:232:2) at Array.<anonymous> (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:205:4) at Storage.finished (/home/pi/Duet3D/DWC/3.4.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16) at /home/pi/Duet3D/DWC/3.4.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9 node:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:471:10) at /home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:503:5 at /home/pi/Duet3D/DWC/3.4.4/node_modules/webpack/lib/NormalModule.js:358:12 at /home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at Array.<anonymous> (/home/pi/Duet3D/DWC/3.4.4/node_modules/loader-runner/lib/LoaderRunner.js:205:4) at Storage.finished (/home/pi/Duet3D/DWC/3.4.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16) at /home/pi/Duet3D/DWC/3.4.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9 at /home/pi/Duet3D/DWC/3.4.4/node_modules/graceful-fs/graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }
-
@oozeBot I didn't see that problem with NodeJS 16 but I can confirm it after upgrading to NodeJS 18. Running
NODE_OPTIONS=--openssl-legacy-provider npm run serve
seems to get it going again.The next DWC v3.5, which uses Webpack v5 instead of v4, is not affected. It's still in WIP, though.
-
@chrishamm
I too am going through the process of setting up DWC on a Pi (3B+ Debian Bullseye) so that I can work on a plugin. I am getting errors runningnpm build serve
(see below).
I have an 1GB RAM and 8GB swap file. Not enough to build DWC? Wrong branch of DWC?Any pointers would be appreciated
After finding this thread, I've installed version 16 of nodejs to try and avoid other issues.
sudo curl -fsSL https://deb.nodesource.com/setup_16.x | sudo bash - && sudo apt install -y nodejs
which results in:
pi@srsender:~ $ npm --version 8.19.2 pi@srsender:~ $ node --version v16.18.1
This is my build script:
cd ~ rm -rf ~/DWC mkdir DWC git clone -b master --depth=1 https://github.com/Duet3D/DuetWebControl DWC cd ~/DWC node --max-old-space-size=7168 `which npm` install npm audit fix node --max-old-space-size=7168 `which npm` run serve
npm install
issues lots of warnings butnpm audit --only prod
gives:pi@srsender:~/DWC $ npm audit --only prod npm WARN config only Use `--omit=dev` to omit dev dependencies from the install. found 0 vulnerabilities
This is the error from
npm run serve
:pi@srsender:~/DWC $ node --max-old-space-size=7168 `which npm` run serve > duetwebcontrol@3.4.4 serve > vue-cli-service serve INFO Starting development server... 68% building 2351/2414 modules 63 active ...node_modules/@babylonjs/core/Gizmos/planeRotationGizmo.js <--- Last few GCs ---> [6720:0x48e68a8] 1372469 ms: Mark-sweep 205.9 (222.5) -> 203.5 (222.7) MB, 3696.4 / 0.6 ms (average mu = 0.322, current mu = 0.296) allocation failure scavenge might not succeed [6720:0x48e68a8] 1378334 ms: Mark-sweep 205.9 (222.7) -> 203.5 (222.5) MB, 4008.1 / 1.0 ms (average mu = 0.319, current mu = 0.317) allocation failure scavenge might not succeed <--- JS stacktrace ---> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory Aborted
-
@stuartofmt I never was able to get DEC to build/debug on anything less that a 4gb RPi 4b and now use an 8gb version. It’s quite slow to build/load but runs just fine once compiled. I’m pretty sure the overhead is just too great for the 1gb (or even 2gb) models.
-
@stuartofmt @oozeBot I would not attempt to develop current versions of DWC on a RaspPi - Webpack just needs too many resources during the build. That's the reason I'd like to switch over to the Vite build environment in v3.6, but not before, because that will require the entire JS/CSS chunk configuration and custom imports plugin to be rewritten.
If I were you, I'd just install NodeJS on a decent PC and develop from there - that's how I do it. You can use
npm run serve
to run a local dev server and connect to remote machines (standalone or SBC mode) by sendingM586 C"*"
to the machine(s) you want to test with. -
@chrishamm said in [DWC 3.4.0] NPM Error:
If I were you, I'd just install NodeJS on a decent PC....
Thanks. I did that over the weekend and it was plain sailing ...
I've got the first part of my plugin running. Now for the tricky bits ....