Error on npm run build - javascript

Error on npm run build. Updating the node-modules or clearing the cache didn't work. Updating the scripts even didn't work. Couldn't resolve the following error
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm#6.0.1
3 info using node#v8.11.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle udemy-nodejs-angular2#1.0.0~prebuild: udemy-nodejs-angular2#1.0.0
6 info lifecycle udemy-nodejs-angular2#1.0.0~build: udemy-nodejs-angular2#1.0.0
7 verbose lifecycle udemy-nodejs-angular2#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle udemy-nodejs-angular2#1.0.0~build: PATH: C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project\node_modules.bin;C:\Users\Bhargavii Nadendla\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Bhargavii Nadendla\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_171\bin;C:\HashiCorp\Vagrant\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Bhargavii Nadendla\Python\Scripts;C:\Users\Bhargavii Nadendla\Python;C:\Users\Bhargavii Nadendla\AppData\Local\Microsoft\WindowsApps;C:\Users\Bhargavii Nadendla\AppData\Local\GitHubDesktop\bin;C:\Users\Bhargavii Nadendla\AppData\Roaming\npm;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle udemy-nodejs-angular2#1.0.0~build: CWD: C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project
10 silly lifecycle udemy-nodejs-angular2#1.0.0~build: Args: [ '/d /s /c',
10 silly lifecycle 'del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch' ]
11 silly lifecycle udemy-nodejs-angular2#1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle udemy-nodejs-angular2#1.0.0~build: Failed to exec build script
13 verbose stack Error: udemy-nodejs-angular2#1.0.0 build: del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
13 verbose stack Exit status 1
c
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid udemy-nodejs-angular2#1.0.0
15 verbose cwd C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build"
18 verbose node v8.11.2
19 verbose npm v6.0.1
20 error code ELIFECYCLE
21 error errno 1
22 error udemy-nodejs-angular2#1.0.0 build: del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
22 error Exit status 1
23 error Failed at the udemy-nodejs-angular2#1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Here, I upload the package.json
{
"name": "udemy-nodejs-angular2",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"build": "del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch",
"build:prod": "del-cli public/js/app && ngc -p tsconfig.aot.json && ngc -p tsconfig.aot.json && webpack --config webpack.config.prod.js --progress --profile --bail && del-cli 'assets/app/**/*.js' 'assets/app/**/*.ngsummary.json' 'assets/app/**/*.ngstyle.*'"
},
"dependencies": {
"#angular/animations": "^5.0.0",
"#angular/common": "^5.0.0",
"#angular/compiler": "^5.0.0",
"#angular/compiler-cli": "^5.0.0",
"#angular/core": "^5.0.0",
"#angular/forms": "^5.0.0",
"#angular/http": "^5.0.0",
"#angular/platform-browser": "^5.0.0",
"#angular/platform-browser-dynamic": "^5.0.0",
"#angular/platform-server": "^5.0.0",
"#angular/router": "^5.0.0",
"#angular/upgrade": "^5.0.0",
"body-parser": "~1.15.2",
"cookie-parser": "~1.4.3",
"core-js": "^2.4.1",
"debug": "~2.2.0",
"express": "~4.14.0",
"hbs": "~3.1.0",
"mongoose": "^5.1.3",
"mongoose-unique-validator": "^2.0.1",
"morgan": "~1.6.1",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.5.11",
"serve-favicon": "~2.3.0",
"zone.js": "^0.8.5"
},
"devDependencies": {
"#ngtools/webpack": "^1.8.0",
"#types/core-js": "0.9.36",
"#types/node": "^6.0.45",
"angular-router-loader": "^0.5.0",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^3.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"del-cli": "^0.2.0",
"html-loader": "^0.4.4",
"raw-loader": "^0.5.1",
"ts-loader": "^2.0.3",
"typescript": "^2.4.2",
"webpack": "^2.7.0",
"webpack-merge": "^4.1.0"
}
}

I've installed with ubuntu on your same package.json and it worked just fine.
I'm using node V8.11, npm 6.10;
It seems that you are using node 6.0 in your machine and node 8.0;
First, a good try is to update your npm to 6.10 and your node to a newer version, or just reinstall node. But it is more likely to be your user having no access to finish the build proccess as you can see in
`
14 verbose pkgid udemy-nodejs-angular2#1.0.0
15 verbose cwd C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Bhargavii Nadendla\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v8.11.2
19 verbose npm v6.0.1
20 error code ELIFECYCLE
21 error errno 1
22 error udemy-nodejs-angular2#1.0.0 build: `del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch`
22 error Exit status 1
`
Whenever that happen i just run sudo on ubuntu and it is fixed. What are the permissions that your user have in the project folder node_modules and essentially in "C:\\Users\\Bhargavii Nadendla\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" ?
If it is not permission related, try out to install a newer version of node and point it out to C: removing it from AppData of windows, this can actually cause a access permission fail.

Related

npm install getting Cannot read property 'name' of null error

Not too sure what is causing this error as npm install works fine on other computers.
NPM and Node versions:
C:\Users\Work>npm -v
8.3.2
C:\Users\Work>node -v
v14.16.1
Here is my log file:
1045 timing metavuln:calculate:security-advisory:laravel-mix:BsF+UACSDcae51QqbAQxlxsAnxFUZFgrvDV6vu6cKmFKYbSYdVVZnALm0hmDv4dJ/hBksQh4SoHNXqfEVpN6eg== Completed in 4ms
1046 verbose stack TypeError: Cannot read property 'name' of null
1046 verbose stack at npa (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-package-arg\npa.js:25:18)
1046 verbose stack at FetcherBase.get (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetcher.js:486:16)
1046 verbose stack at Object.packument (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\index.js:18:30)
1046 verbose stack at Calculator.[packument] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\metavuln-calculator\lib\index.js:105:22)
1046 verbose stack at Calculator.[calculate] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\metavuln-calculator\lib\index.js:56:23)
1046 verbose stack at Calculator.calculate (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\metavuln-calculator\lib\index.js:43:31)
1046 verbose stack at Map.[init] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\audit-report.js:173:36)
1046 verbose stack at async Map.run (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\audit-report.js:108:7)
1047 verbose cwd D:\code\click-webplanner
1048 verbose Windows_NT 10.0.19042
1049 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
1050 verbose node v14.16.1
1051 verbose npm v7.20.3
1052 error Cannot read property 'name' of null
1053 verbose exit 1
And this is my composer file:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.16.2",
"bootstrap-sass": "^3.4.0",
"cross-env": "^5.0.1",
"deepmerge": "^4.2.2",
"fibers": "^5.0.0",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"lodash": "^4.17.4",
"sass": "^1.26.8",
"sass-loader": "^8.0.2",
"save": "^2.3.3",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue": "^2.6.3",
"vue-template-compiler": "^2.6.3",
"webpack": "^4.43.0"
},
"dependencies": {
"#babel/core": "^7.3.4",
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#babel/preset-env": "^7.4.4",
"#tailwindcss/postcss7-compat": "^2.0.2",
"ajv": "^6.8.1",
"autoprefixer": "^9.8.6",
"axios-cancel": "^0.2.2",
"date-fns": "^2.0.0-alpha.27",
"dayjs": "^1.8.28",
"flatpickr": "^4.5.2",
"highlight.js": "^10.1.2",
"laravel-echo": "^1.5.3",
"laravel-mix": "^5.0.4",
"marked": "latest",
"moment": "^2.29.1",
"npm": "^6.9.0",
"postcss": "^7.0.35",
"prismjs": "^1.23.0",
"prosemirror-utils": "^0.6.7",
"pusher-js": "^4.4.0",
"sweetalert": "^2.1.0",
"sweetalert2": "^7.33.1",
"tailwindcss": "npm:#tailwindcss/postcss7-compat#^2.0.2",
"tiptap": "^0.19.0",
"tiptap-extensions": "^0.21.0",
"vue-bulma-datepicker": "^1.3.6",
"vue-fuse": "^3.0.0",
"vue-select": "^3.1.0",
"vue-select2": "^0.2.6",
"vue-sidebar-menu": "^3.7.0",
"vue2-editor": "^2.6.6",
"vuedraggable": "^2.17.0",
"vuetify": "^2.2.33",
"vuetify-loader": "^1.4.4"
}
}
This error is occurring with the npm version that you are using: v8.3.2 and the way that you passing the version of the module "tailwindcss": "npm:#tailwindcss/postcss7-compat#^2.0.2"
If you remove this library will see that the error will stop to happen.
To solve this you can change the tailwindcss version to ^2.0.1-compat:
"tailwindcss": "^2.0.1-compat"
Or upgrade or downgrade your npm version:
Try to downgrade your node.js and npm version for other lts version like the lts/fermium (node v14.19.0, npm v6.14.16) or upgrade to the stable version (node v17.5.0, npm v8.4.1)
Also, the recommended version for the npm with the node version v14.16.1 is the is 6.14.12 and not 8.3.2 as we can see in the releases table.
When you change the npm version you will need:
Delete the node_modules directory and package-lock.json file.
Reinstall the modules using npm install

make: *** [Release/obj.target/binding/src/binding.o] Error 1 when using dart sass

Because the node-sass was no longer maintain and did no compatiable with the higher version of node, so I tried to change the node-sass to dart-sass, when I use the dart-sass in the vue project like this:
"sass": "1.48.0",
shows error:
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:710:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/Users/xiaoqiangjiang/source/reddwarf/frontend/crx-selection-translate/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 21.1.0
npm ERR! gyp ERR! command "/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/bin/node" "/Users/xiaoqiangjiang/source/reddwarf/frontend/crx-selection-translate/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/xiaoqiangjiang/source/reddwarf/frontend/crx-selection-translate/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xiaoqiangjiang/.npm/_logs/2022-01-15T11_36_53_164Z-debug.log
why did this happen? what should I do fix this problem? This is my project package.json:
{
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/jiangxiaoqiang/crx-selection-translate.git"
},
"scripts": {
"xpostinstall": "node ./build/install-pdf-viewer",
"dev": "webpack --config build/webpack.dev.config.js",
"build": "gulp --cwd . --gulpfile build/gulp-build.js",
"test": "karma start build/karma.config.js"
},
"dependencies": {
"bootstrap-sass": "^3.4.1",
"chrome-call": "^1.0.2",
"connect.io": "^3.1.3",
"interact.js": "^1.2.6",
"js-wheel": "git+https://github.com/jiangxiaoqiang/js-wheel.git",
"translation.js": "git+https://github.com/jiangxiaoqiang/translation.js.git",
"vue": "^1.0.24",
"vue-router": "^0.7.11"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^6.2.4",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-3": "^6.5.0",
"chrome-env": "^0.0.6",
"css-loader": "^0.23.1",
"del": "^2.2.0",
"download": "^5.0.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"fs-extra": "^8.1.0",
"gulp": "^3.9.1",
"gulp-clean-css": "^2.3.2",
"gulp-htmlmin": "^2.0.0",
"gulp-jsonmin": "^1.2.0",
"gulp-uglify": "^1.5.3",
"gulp-zip": "^3.2.0",
"isparta-loader": "^2.0.0",
"jasmine-core": "^2.99.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.1.2",
"karma-coveralls": "^1.2.1",
"karma-firefox-launcher": "^1.3.0",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^1.7.0",
"phantomjs-prebuilt": "^2.1.6",
"raw-loader": "^0.5.1",
"sass": "1.48.0",
"sass-loader": "^3.2.0",
"style-loader": "^0.13.0",
"vue-html-loader": "^1.2.0",
"webpack": "^1.13.1"
},
"author": "Jiangxiaoqiang <jiangtingqiang#gmail.com>",
"license": "GPLv3",
"bugs": {
"url": "https://github.com/jiangxiaoqiang/crx-selection-translate/issues"
},
"homepage": "https://github.com/jiangxiaoqiang/crx-selection-translate#readme"
}
the node version is 16 and the os was macOS moteney with M1 chip.
Not sure if this is the same issue but I was able to fix the installation by using the following commands:
rm -rf node_modules
rm yarn.lock
yarn install -std=c++17
Found the answer with an explanation here
Additional troubleshooting I ran into that unrelated to this exact question:
If unable to load external module #babel/register make sure that both babel-core and babel-register are installed as well as the gulp-cli: yarn global add gulp-cli.
If using node-sass and receiving the following error:
Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (108)
remove node-sass and use dart-sass:
npm uninstall gulp-sass
npm uninstall gulp-sass-lint
npm i gulp-dart-sass
I had the same issue on my Mac M1. In my case, sass and node versions were not matching. I had to downgrade node from 16.x to 12.x. I guess, if that is possible upgrading sass should also work, but I never did that.
Command Line DartSass for Mac m1
First of all install the missing packages at https://brew.sh/
Copy this:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After: npm i -d sass
after a careful research it seems that m1 is missing many packages to make dart sass work for this reason everything that is missing must be installed with the line written above.

npm run build ELIFECYCLE error with ReactJS

I tried looking it up on older posts and I've tried the usual reinstall modules/clean npm cache. The code runs fine with npm start on localhost but whenever I try build/deploy the project I get the following:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.10
3 info using node#v14.15.4
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle portfolio#0.1.0~prebuild: portfolio#0.1.0
6 info lifecycle portfolio#0.1.0~build: portfolio#0.1.0
7 verbose lifecycle portfolio#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle portfolio#0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\JS_Learn\porfolio1\portfolio\node_modules\.bin;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\JS_Learn\porfolio1\portfolio\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\nodejs\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Users\belch\AppData\Roaming\npm;
9 verbose lifecycle portfolio#0.1.0~build: CWD: F:\JS_Learn\porfolio1\portfolio
10 silly lifecycle portfolio#0.1.0~build: Args: [ '/d /s /c', 'react-scripts build' ]
11 silly lifecycle portfolio#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle portfolio#0.1.0~build: Failed to exec build script
13 verbose stack Error: portfolio#0.1.0 build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid portfolio#0.1.0
15 verbose cwd F:\JS_Learn\porfolio1\portfolio
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.15.4
19 verbose npm v6.14.10
20 error code ELIFECYCLE
21 error errno 1
22 error portfolio#0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the portfolio#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json for reference, tried to delete it and reinstall every single dependecy manually aswell:
{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"dependencies": {
"#fortawesome/fontawesome-free": "^5.15.2",
"#testing-library/jest-dom": "^5.11.9",
"#testing-library/react": "^11.2.5",
"#testing-library/user-event": "^12.8.1",
"aos": "^3.0.0-beta.6",
"emailjs-com": "^2.6.4",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-lazyload": "^3.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-spring": "^8.0.27",
"web-vitals": "^1.1.0"
},
"homepage": "http://MyUserJustIgnore.github.io/portfoliov1",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.1.0"
}
}

webpack-cli Unknown argument and SyntaxError

i'm new to prestashop theme development.
i had setup my local enviroment and all works fine.
i try to build a theme from the classic default theme.
i go into the _dev folted inside the theme and run "npm install".
next i run "npm run build" to run the script: "build": "NODE_ENV=production webpack --progress --colors --debug --display-chunks"
and i get the following error:
> ADMIN#DESKTOP-5JOQKQA MINGW64 /c/laragon/www/PrestaShopDev/themes/prodet/_dev ((1.7.7.0))
> $ npm run build
>
> > prestashop-classic-dev-tools#1.0.0 build C:\laragon\www\PrestaShopDev\themes\prodet\_dev
> > NODE_ENV=production webpack --progress --colors --debug --display-chunks
>
> [webpack-cli] Unknown argument: --colors
> Did you mean --color?
> [webpack-cli] Unknown argument: --debug
> [webpack-cli] Unknown argument: --display-chunks
> Note: This command was run via npm module 'win-node-env'
> npm ERR! code ELIFECYCLE
> npm ERR! errno 2
> npm ERR! prestashop-classic-dev-tools#1.0.0 build: `NODE_ENV=production webpack --progress --colors --debug
> --display-chunks`
> npm ERR! Exit status 2
> npm ERR!
> npm ERR! Failed at the prestashop-classic-dev-tools#1.0.0 build 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\ADMIN\AppData\Roaming\npm-cache\_logs\2020-12-11T16_17_37_009Z-debug.log
how can i fix it?
here is the package.json file:
{
"name": "prestashop-classic-dev-tools",
"version": "1.0.0",
"description": "Tools to help while developing the Classic theme",
"main": "index.js",
"scripts": {
"build": "NODE_ENV=production webpack --progress --colors --debug --display-chunks",
"watch": "webpack --progress --colors --debug --display-chunks --watch"
},
"author": "PrestaShop",
"license": "AFL-3.0",
"devDependencies": {
"autoprefixer": "^6.7.7",
"babel-loader": "^8.2.2",
"bootstrap": "4.0.0-alpha.5",
"bootstrap-touchspin": "^3.1.1",
"bourbon": "^4.2.6",
"css-loader": "^5.0.1",
"expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.10.1",
"flexibility": "^1.0.5",
"jquery": "^3.5.1",
"jquery-touchswipe": "^1.6",
"jquery.browser": "^0.1.0",
"material-design-icons": "^2.1.3",
"node-sass": "^4.14.1",
"notosans-fontface": "~1.0.1",
"postcss-flexibility": "^1.0.2",
"postcss-loader": "^1.3.3",
"sass-loader": "^6.0.3",
"style-loader": "^0.14.1",
"tether": "^1.1.1",
"velocity-animate": "^1.2.3",
"webpack": "^5.10.0",
"webpack-cli": "^4.2.0",
"webpack-sources": "^0.1.0"
}
}
my node version is:
$ node -v
v10.18.1
my npm version is:
$ npm -v
6.13.4
i really don't understand how to fix this.
I am also new to prestashop development.
I had the same error.
I solved it using a second clone of the classic folder.
the error is probably due to the webpack version.
Here is the package.json
{
"name": "prestashop-classic-dev-tools",
"version": "1.0.0",
"description": "Tools to help while developing the Classic theme",
"main": "index.js",
"scripts": {
"build": "NODE_ENV=production webpack --progress --colors --debug --display-chunks",
"watch": "webpack --progress --colors --debug --display-chunks --watch"
},
"author": "PrestaShop",
"license": "AFL-3.0",
"devDependencies": {
"autoprefixer": "^6.7.7",
"babel-loader": "^5.3.2",
"bootstrap": "4.0.0-alpha.5",
"bootstrap-touchspin": "^3.1.1",
"bourbon": "^4.2.6",
"css-loader": "^0.27.3",
"expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.10.1",
"flexibility": "^1.0.5",
"jquery": "^2.1.4",
"material-design-icons": "^2.1.3",
"node-sass": "^4.14.1",
"notosans-fontface": "~1.0.1",
"postcss-flexibility": "^1.0.2",
"postcss-loader": "^1.3.3",
"sass-loader": "^6.0.3",
"style-loader": "^0.14.0",
"tether": "^1.1.1",
"velocity-animate": "^1.2.3",
"webpack": "^2.2.1",
"webpack-sources": "^0.1.0"
}
}
in the clone after
npm install
npm run build
For me, it worked and compiles the theme

npm install returns no valid versions available for pinkie-promise

I am trying to do a very simple "npm install" from one of the repos found from a tutorial found here
The package.json is as follows:
{
"name": "react-playlist",
"version": "1.0.0",
"description": "A simple react to-do list",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run build",
"build": "webpack -d && webpack-dev-server --content-base src/ --inline --
hot --port 1234 --history-api-fallback"
},
"repository": {
"type": "git",
"url": "git+https://github.com/iamshaunjp/react-playlist.git"
},
"keywords": [
"react"
],
"author": "The Net Ninja",
"license": "MIT",
"bugs": {
"url": "https://github.com/iamshaunjp/react-playlist/issues"
},
"homepage": "https://github.com/iamshaunjp/react-playlist#readme",
"dependencies": {
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-router": "^3.0.0"
},
"devDependencies": {
"babel-core": "^6.16.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.16.0",
"babel-preset-react": "^6.16.0",
"css-loader": "^0.25.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.16.1"
}
}
When I run "npm install", I get an error about "no valid versions available for pinkie-promise". I looked on npm, and it seems pinkie-promise is deprecated and removed. How do I remove it from my package.json if it doesn't even show up there?
Here is the npm log for this error (Only included the bit with the error):
1281 silly resolveWithNewModule commondir#1.0.1 checking installable status
1282 silly pacote range manifest for pkg-dir#^1.0.0 fetched in 3ms
1283 silly resolveWithNewModule pkg-dir#1.0.0 checking installable status
1284 silly pacote range manifest for find-up#^1.0.0 fetched in 2ms
1285 silly resolveWithNewModule find-up#1.1.2 checking installable status
1286 silly fetchPackageMetaData error for pinkie-promise#^2.0.0 No valid
versions available for pinkie-promise
1287 silly pacote range manifest for path-exists#^2.0.0 fetched in 4ms
1288 silly resolveWithNewModule path-exists#2.1.0 checking installable status
1289 verbose type range
1290 verbose stack pinkie-promise: No valid versions available for pinkie-
promise
1290 verbose stack at pickManifest
(/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/npm-pick-
manifest/index.js:19:11)
1290 verbose stack at fetchPackument.then.packument
1290 verbose stack at tryCatcher
at runCallback (timers.js:800:20)
1290 verbose stack at tryOnImmediate (timers.js:762:5)
1290 verbose stack at processImmediate [as _immediateCallback]
(timers.js:733:5)
1291 verbose cwd /root/Desktop/LeagueSystemWebApp
1292 verbose Linux 4.4.0-104-generic
1293 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
1294 verbose node v9.2.1
1295 verbose npm v5.5.1
1296 error code ENOVERSIONS
1297 error No valid versions available for pinkie-promise
1298 verbose exit [ 1, true ]
A work around is to npm install pinkie-promise by pointing to their github repo.
npm install https://github.com/floatdrop/pinkie-promise.git
It is not your mistake.
Official issue: https://github.com/npm/registry/issues/255
Official status: https://status.npmjs.org/incidents/41zfb8qpvrdj

Categories

Resources