npm not install underscore packages - javascript

I want to install packages with npm:
my packages file is:
"dependencies": {
"express": "~3.3.6",
"socket.io": "0.9.16",
"jade": "~0.35.0",
"less-middleware": "~0.1.12",
"redis": "~0.8.4",
"connect-redis": "~1.4.5",
"longjohn": "~0.2.1",
"mongoose": "~3.6.20",
"json-stringify-safe": "~5.0.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.2",
"grunt-nodemon": "~0.1.0",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-less": "~0.7.0",
"grunt-ngmin": "0.0.3"
}
}
but i have this error :
npm http 304 https://registry.npmjs.org/underscore.string
npm ERR! Error: No compatible version found: underscore.string#'~2.2.0rc'
npm ERR! Valid install targets:
npm ERR! ["0.9.2","1.0.0","1.1.3","1.1.4","1.1.5","1.1.6","2.0.0","2.1.0","2.1.1","2.3.0","2.3.1","2.3.2","2.2.1","2.2.0-rc","2.3.3"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:685:10)
npm ERR! at /usr/share/npm/lib/cache.js:607:10
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/vahid/Workspace/talkie/npm-debug.log npm
npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/vahid/Workspace/talkie
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
how i can fix this error? thanks!

If you have a Grunt version that has not yet applied this patch, then you will get that error due to a mistype where this line in the package.json:
underscore.string#'~2.2.0rc
Should instead be this:
underscore.string#'~2.2.0-rc
To fix this problem, use a newer version of Grunt.

in package.json change sails ">0.9"
and grunt ">0.4.1"
thats all

Related

error occured when do npm install && npm run dev - Vite - Laravel UI React

hello everyone today i had a problem that's when i install laravel ui with react and pass to the step of npm install an error occured so below you will find the error
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\E495\AppData\Local\npm-cache\_logs\2023-01-16T08_08_36_872Z-debug-0.log
PS C:\Users\E495\Desktop\laravel-simple-crud> npm install
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: vite#4.0.4
npm ERR! node_modules/vite
npm ERR! dev vite#"^4.0.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite#"^3.0.0" from #vitejs/plugin-react#2.2.0
npm ERR! node_modules/#vitejs/plugin-react
npm ERR! dev #vitejs/plugin-react#"^2.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\E495\AppData\Local\npm-cache\eresolve-report.txt for a full report.
so above the error and below you'll find my package.json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"#popperjs/core": "^2.11.6",
"#tailwindcss/forms": "^0.5.2",
"#vitejs/plugin-react": "^2.2.0",
"alpinejs": "^3.4.2",
"autoprefixer": "^10.4.2",
"axios": "^1.1.2",
"bootstrap": "^5.2.3",
"laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.19",
"postcss": "^8.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.56.1",
"tailwindcss": "^3.1.0",
"vite": "^4.0.4"
}
}
i try to read the error and change the vite version to 4.0.4 but without any result
You should be able to get by this error with the following command:
npm install --legacy-peer-deps
This previous post goes into detail about what --legacy-peer-deps is doing here.
In short, #vitejs/plugin-react (specifically the version 2.2.0 you have as a dev dependency) has listed an older version of vite (vite#"^3.0.0") as one of its peer dependencies, but it is finding the newer vite#"^4.0.4" installed. For reasons that I can't totally explain (see the linked post or Google if you're curious), NPM is not able to resolve this peer dependency conflict as it usually would for the regular dependencies and dev dependencies that we're more familiar with. --legacy-peer-deps gets around this by bypassing peer dependency auto-installation.

Webpack and webpack-dev-server installation error

I'm trying to install a Webpack and Babel to use React without CRA.
During installation webpack-dev-server, I've facing with some dependencies problems
PS C:\Users\Lebedev\Desktop\projects\frontend-graduation-project> npm install --save-dev webpack-dev-server
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack#5.4.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#">=2" from babel-loader#8.2.1
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader#"^8.2.1" from the root project
npm ERR! peer webpack#"^4.27.0 || ^5.0.0" from css-loader#5.0.1
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"^5.0.1" from the root project
npm ERR! 6 more (html-webpack-plugin, style-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^4.0.0" from webpack-dev-middleware#3.7.2
npm ERR! node_modules/webpack-dev-server/node_modules/webpack-dev-middleware
npm ERR! webpack-dev-middleware#"^3.7.2" from webpack-dev-server#3.11.0
npm ERR! node_modules/webpack-dev-server
npm ERR! dev webpack-dev-server#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Lebedev\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lebedev\AppData\Local\npm-cache\_logs\2020-11-15T12_42_34_324Z-debug.log
PS C:\Users\Lebedev\Desktop\projects\frontend-graduation-project>
My package.json file:
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"#babel/core": "^7.12.3",
"#babel/preset-env": "^7.12.1",
"#babel/preset-react": "^7.12.5",
"babel-loader": "^8.2.1",
"css-loader": "^5.0.1",
"html-webpack-plugin": "^4.5.0",
"style-loader": "^2.0.0",
"webpack": "^5.4.0",
"webpack-cli": "^4.2.0"
}
What I already did and it still not help:
Tried remove node_modules folder
Tried remove package-lock.json file
Reinstall npm dependencies by running this command: npm install
How to solve this problems?
Thanks for any advice
I found the answer on a Github Issue page: https://github.com/npm/cli/issues/2119
My npm version has been 7.0.8. As a mvyunko mention in issue, I just type the following:
npm install npm#latest -g
npm install webpack-dev-server --save-dev
After all commands, my npm version has been changed to 6.14.8, and installation error has gone.

Failed to start script in Nodejs Application

I was using Nodemon.js. For production i decided to delete nodemon and set script "start" to "node index.js" but now i am encountering this error. ( I have completely uninstalled nodemon from my system, deleted from dependencies, re-installed node.)
Already tried Npm cache clean --force,
Uninstalled Node multiple times
> hpgrmnode#1.0.0 start E:\Abhi\hpgrmnode
> node index.js
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! file E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! path E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! errno ENOENT
npm ERR! hpgrmnode#1.0.0 start: `node index.js`
npm ERR! spawn E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js ENOENT
npm ERR!
npm ERR! Failed at the hpgrmnode#1.0.0 start 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\Mukesh\AppData\Roaming\npm-cache\_logs\2020-06-02T16_31_24_429Z-debug.log
This is log file
https://pastebin.com/EAiKbBii
Note
I have recently changed my folder name from hpgrm_node to hpgrmnode but still the path is showing for hpgrm_node
*** npm ERR! file E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! path E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
Dependencies
{
"name": "hpgrmnode",
"version": "1.0.0",
"description": "HPGRM web application",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"author": "Abhishek",
"license": "ISC",
"dependencies": {
"alert": "^5.0.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"connect-flash": "^0.1.1",
"connect-mongo": "^3.2.0",
"dotenv": "^8.2.0",
"edge.js": "^1.1.4",
"express": "^4.17.1",
"express-edge": "^2.0.2",
"express-fileupload": "^1.1.7-alpha.3",
"express-session": "^1.17.1",
"helmet": "^3.22.0",
"mongoose": "^5.9.16"
},
"engines": {
"node": "12.16.1"
}
}
With simple command "> node index.js"
Getting this warning
E:\Abhi\hpgrmnode>node index.js
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
And if i am trying to install nodemon
getting this error
E:\Abhi\hpgrmnode>npm install nodemon --save-dev
> nodemon#2.0.4 postinstall E:\Abhi\hpgrmnode\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN hpgrmnode#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! file E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! path E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js
npm ERR! errno ENOENT
npm ERR! nodemon#2.0.4 postinstall: `node bin/postinstall || exit 0`
npm ERR! spawn E:\Abhi\hpgrm_Node\node_modules\nodemon\bin\nodemon.js ENOENT
npm ERR!
npm ERR! Failed at the nodemon#2.0.4 postinstall 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\Mukesh\AppData\Roaming\npm-cache\_logs\2020-06-02T16_49_22_968Z-debug.log

Angular starting errors in package.json

Shortform:
While using 'Angular' for the first time I run in an Error telling me that tsc hasn't been found (package.json at the end).
Detail:
I am new to Angular and while I started an example from a book with
npm start I run in an Error with my package.json file. tsc: not found Error
sh: 1: tsc: not found
npm ERR! blog-app#1.0.0 start: `tsc && npm run copy:html && concurrently "npm run tsc:w" "npm run html:watch" "live-server" `
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the blog-app#1.0.0 start script.
npm ERR! This is most likely a problem with the blog-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && npm run copy:html && concurrently "npm run tsc:w" "npm run html:watch" "live-server"
npm ERR! You can get their info via:
npm ERR! npm owner ls blog-app
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular/npm-debug.log
npm ERR! not ok code 0
I was supposed to run npm install in the directory of that distribution causing the follow error:
(node:1635) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json blog-app#1.0.0 No README data
npm WARN deprecated typings#1.0.4: Typings is deprecated in favor of NPM #types -- see README for more information
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/webpages/angulartry
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/webpages/angulartry/npm-debug.log
npm ERR! not ok code 0
i removed it multiple times and reinstalled it with npm install -g typescript.
npm install && npm start causes the following error
(node:1814) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json blog-app#1.0.0 No README data
npm WARN deprecated typings#1.0.4: Typings is deprecated in favor of NPM #types -- see README for more information
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular/npm-debug.log
npm ERR! not ok code 0
If I remove tsc && from line 11
"start": "tsc && npm run copy:html
&& concurrently \"npm run tsc:w\" \"npm run html:watch\"
\"live-server\" ", , I run in the following error sh: 1:
copyfiles: not found.
About the System:
The System is running on a Raspberry Pi with Raspbian using npm version npm: '1.4.21'.
My Typescript Version seems to be 2.2.1. If it matters, I control the System from a Putty.
The package.json file:
{
"name": "blog-app",
"version": "1.0.0",
"description": "Blog Applikation",
"watch": {
"copy:html": "./app/**/*.html"
},
"scripts": {
"tsc": "./node_modules/.bin/tsc",
"tsc:w": "./node_modules/.bin/tsc --watch",
"start": "tsc && npm run copy:html && concurrently \"npm run tsc:w\" \"npm run html:watch\" \"live-server\" ",
"html:watch": "onchange \"./app/**/*.html\" -v -- npm run copy:html",
"copy:html": "copyfiles -u 1 ./app/**/*.html dist"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#angular/common": ">=4.0.0-beta <5.0.0",
"#angular/compiler": ">=4.0.0-beta <5.0.0",
"#angular/core": ">=4.0.0-beta <5.0.0",
"#angular/forms": ">=4.0.0-beta <5.0.0",
"#angular/http": ">=4.0.0-beta <5.0.0",
"#angular/platform-browser": ">=4.0.0-beta <5.0.0",
"#angular/platform-browser-dynamic": ">=4.0.0-beta <5.0.0",
"systemjs": "0.19.27",
"core-js": "2.4.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.1.0",
"zone.js": "0.8.4",
"bootstrap": "3.3.6"
},
"devDependencies": {
"canonical-path": "0.0.2",
"concurrently": "2.2.0",
"copyfiles": "1.0.0",
"http-server": "0.9.0",
"live-server": "1.1.0",
"lodash": "4.11.1",
"npm-watch": "0.1.6",
"onchange": "3.0.2",
"rimraf": "2.5.2",
"tslint": "3.7.4",
"typescript": "2.2.0",
"typings": "1.0.4"
},
"repository": {}
}
It looks like the typescript did not be installed successfully. You can try :
npm install -g typescript
And then
npm install && npm start
My advice is to generate project using angular cli and check its package.json file, it looks a bit different than yours

How to install socket.io and mysql on Node.js

I'm too newbie to Node.js.
I'm trying to setup a basic site (in order to learn), to make a call from Javascript in front end to Node.js and return the data of a mysql query.
I followed some tutorials in internet and I made this packages.json file
{
"name": "Stock",
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-watch": "^0.6.1",
"grunt-execute": "^0.2.2",
"socket.io":"lastest"
}
}
Then on my Linux I run: npm install Which I understand it will install all dependencies listed on the packages.json. But I'm getting this error:
npm WARN package.json Stock#0.0.1 No description
npm WARN package.json Stock#0.0.1 No repository field.
npm WARN package.json Stock#0.0.1 No README data
npm http GET https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/socket.io
npm ERR! Error: No compatible version found: socket.io#'lastest'
npm ERR! Valid install targets:
npm ERR! ["0.3.8","0.4.0","0.4.1","0.5.1","0.5.3","0.6.0","0.6.1","0.6.3","0.6.4","0.6.5","0.6.6","0.6.7","0.6.8","0.6.9","0.6.10","0.6.11","0.6.12","0.6.14","0.6.15","0.6.16","0.6.17","0.6.18","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.7.8","0.7.9","0.7.10","0.7.11","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5","0.8.6","0.8.7","0.9.0","0.9.1","0.9.1-1","0.9.2","0.9.3","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","0.9.10","0.9.11","0.9.12","0.9.13","0.9.14","0.9.15","0.9.16","1.0.0-pre","1.0.0-pre2","1.0.0-pre3","1.0.0-pre4","1.0.0-pre5","0.9.17","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.1.0","1.2.0","1.2.1","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:719:10)
npm ERR! at /usr/share/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.19.0-31-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pablo/Documents/clients/stock/node
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pablo/Documents/clients/stock/node/npm-debug.log
npm ERR! not ok code 0
I guess latest version for socket.io, is not ok? how would it work?
Part of the code I get from Here
You have a typo in the socket.io version. "socket.io":"lastest" should be changed to "socket.io":"latest".
it's supposed to be "latest" not "lastest"

Categories

Resources