my cli dont work with npx command become an error - npm

have a little problem with my npm package it works with npm but not when I used npx. Do I understand correctly that if I use npx i don't have to do an installation ?
Become this error -> Error: ENOENT: no such file or directory, lstat
but npx should install everything temporary or not ?
Here is the link to my npm package:
https://www.npmjs.com/package/sweetstack?activeTab=readme
Thank you so much for help
Had is install with npm i -g sweetstack and starting sweetstack how it's run.

Related

Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\pagefile.sys'

I keep running into problem when I tried to run my Vue app today using the npm run serve command. I've done this countless time with the same repository but it gave this error when I started it just now.
This dependency was not found:
* node:console in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/News.vue?vue&type=script&lang=js&
To install it, you can run: npm install --save node:console
Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\pagefile.sys'
What I have tried to fix the problem:
Updates all the packages using npm install
Deleted the node_modules folder and reinstalled the entire dependency
Reload the git repository to the point where it still worked previously
Installed node:console using the command npm install --save node:console which returns the following error instead:
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "node:": node:console
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-06-03T16_45_28_752Z-debug.log
Obviously, none of the fixes had work.
Nevermind my error. It seems in my careless mistake I've appended import {timeEnd} from 'node:console' to the News.vue file just prior to creating a commit
execute command as admin
powercfg -h off

"PulseTile-RA" cannot run. Is it an npm dependency issue?

I wanted to experiment with this project based on react-admin:
https://github.com/PulseTile/PulseTile-RA
So I downloaded the code, run npm install and I got a lot of errors from NPM mainly axios version corrupted.
Example:
npm ERR! code EINTEGRITY
npm ERR! sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= integrity checksum failed when using sha1: wanted sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= but got sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g== sha1-/z8N4ue10YDnV62YAA8Qgbh7zqM=. (75833 bytes)
npm WARN tarball tarball data for js-yaml#3.13.1 (sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==) seems to be corrupted. Trying one more time.
npm ERR! code EINTEGRITY
npm ERR! sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ== integrity checksum failed when using sha512: wanted sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ== but got sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==. (74050 bytes)
npm WARN tar ENOENT: no such file or directory, open 'C:\nodejs\xxx\PulseTile-RA\node_modules\.staging\babel-plugin-transform-object-rest-spread-7e34a6f0\package.json'*
When I do npm start I get an error that react-scripts doesn't exist.
I tried workarounds for similar errors on stackoverflow but without success. And yet still, I cannot get it to run. I have latest NPM, node on windows 10.
Please advise on NPM issues as I think this is the source of this project issue of not starting.
Thank you
So technically, this has more to do with npm than the actual project.
In fact, this issue reported to the npm repository would help.
But here are some quick steps that should help:
Since you're in windows-10, it's advisable to run the "delete" commands within git bash.
Go to the project directory (root folder)
Delete the node_modules directory: rm -rf node_modules
Delete package-lock.json file:rm package-lock.json`
Clear the cache: npm cache clean --force
Run npm install --verbose
If it doesn't help, then please follow more instructions here

How to fix "npm ERR! Unexpected end of JSON input while parsing" on Vue CLI installation

I want to install Vue CLI . and i run this on my Git Bash .
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
but having error like this :
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
npm ERR! Unexpected end of JSON input while parsing near '...ery":"latest","throug'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ECLIPSE\AppData\Roaming\npm-cache\_logs\2019-10-09T02_48_52_427Z-debug.log
i try with solution in stackoverflow in this thread here
. i try with
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~/Desktop
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
but i try to install again , its have same error . someone can help me about this ?
I had a very similar problem and simple npm cache clean --force command did not help too.
I solved the problem by deleting C:\Users\User\AppData\Roaming\npm and C:\Users\User\AppData\Roaming\npm-cache directories and running an npm cache clean --force command after this. Then, npm install worked properly.
If the problem continues to appear, reinstall Node.js and NPM. Do not forget to check if all previous files connected with them are deleted before the installation!
This process work for me
1 - Run your Command Invite/Terminal as Administrator
2 - Install the Vue CLI globally with the command :
npm install -g vue-cli

NPM: ENOENT: no such file or directory, rename

I was using gulp on the project, then i decide to deleted all the dev dependencies to switch to webpack, but every time i try to install using npm is get this error:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\fsevents-e80c4ef4\node_modules\are-we-there-yet' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\are-we-there-yet-5db4c798'
npm ERR! path C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\acorn
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\acorn' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.acorn.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MiguelFrias\AppData\Roaming\npm-cache\_logs\2018-04-04T11_54_23_587Z-debug.log
any idea what can be happening.
just delete package-lock.json file and then install packages, that's all you need and should be works
rm package-lock.json && npm i
When I got this error I looked for all running instances of node in my task manager (i use process explorer on windows) and close/kill all running instances of node. For me its often webstorm or vs code. After closing these programs and ensuring there is no running node process npm install works again.
cache verify command resolved the issue for me
npm cache verify
I remove node_modules and package_lock.json. Then, npm install and it works
Iam using
-node v15.5.0
-npm v6.14.10
Try this:
close "expo start"
remove "package-lock.json"
Try to install packages now
example: npm i #react-navigation/native
This will fix the issue.
The simplest fix for me was:
npm uninstall -g
Then:
npm install -g
The second line may give a hint on what's happening:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\fsevents-e80c4ef4\node_modules\are-we-there-yet' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\are-we-there-yet-5db4c798'
It looks like npm doesn't have enough permission on the folder you're trying to use.
You can try:
Delete the npm_modules again.
Open whatever editor/terminal you're using to npm install with admin permission.
I found a solution for the problem, apparently is some kinda problem with the last version of npm, i was using npm version 5.6.0 and i downgraded to npm version 5.3.0. This did work after all, after intall a couple packages i still get the same error.
ok change version of npm for the last version 5.8.0 now everything working just perfect, before was some kind of problem with atom that denied the permission the building process to install the dependencies of the package.
I just retried to run
npm install
and it succeeded
For me, package-lock.json was not created and script was failing before itself.
This fixed my issue:
- deleted my node_modules.
- npm cache clean
- opened cmd as administrator at the repository folder
- logged-in to the https://registry.npmjs.org/ using username and passoward as few of my components needed authentication to install.
- npm i
If you ever get this error, the hotfix is to follow these steps:
delete node-modules folder
run command npm cache clean --force
run command npm install
install the package again with npm install your-package-name
Actually the current package you are installing has some dependencies which is not being found my npm. So, before installing this package just perform the following command. (It will install all your listed dependencies mentioned in package.json file which are necesaary to run your application)
npm install
It works...!
For not to delete package-lock.json or node_modules every time, just add file ".npmrc" with content "package-lock=false", or add this string if file ".npmrc" already exists.
You can try by removing the package-lock.json with the command rm package-lock.json then you go to the Node.JS website you 'install it' by going to LTS then after your node is updated run npm install in your terminal and that worked for me.
Just update the node to the latest version.
It solved my problem.
I was running command in Ubuntu wsl and it wasn't working so i tried running in cmd prompt and it worked
Kindly check any package.json is open anywhere, then close it first then retry.
For me I just deleted both package-lock.json & node_modules folder. Now everything works great 😃
Another thing I've seen a lot on projects that have been around and gone through multiple contributors:
Double check to see if anyone on your team has simultaneously done a npm install and yarn.
The tell-tale sign is you'll see a package-lock.json (generated by npm) and yarn-lock.json (generated by yarn) in the same repo. This can cause side-effects from collisions in the node_modules folder.
You can try dumping that folder locally, establishing a package manager of choice for your project and instructing the whole team on best practices.
For me I had to sudo the npm install command. Don't know why... Don't want to know either.
sudo npm install --save-dev my_package
These steps work for me:
1. run "npm cache verify" or
2. remove node_modules and package-lock.json
and rerun command)
Sometimes it can be the fault of the package you are trying to install. If that package is a local package and has a node_modules folder. Try:
cd /path/to/package
rm -rf package-lock.json npm-shrinkwrap
npm install
Happen to me when I was coding react native app with expo,
when I was run the app and try to install form npm happen that error.
So just stop run the app and reinstall the package
for me it work fine
Updating npm to latest version worked for me.
A combination of the answers from above worked for me:
Restart the computer ( in my case WSL );
Run the commands from bellow from your chosen terminal, not from VSCode terminal
npm cache clean -f
rm -rf node_modules
rm package-lock.json
npm install
Good luck! :) ✌
Dont run cmd in root of a directory.
there might be one directory inside which u try to run.
cd Directory
npm i
In may case, it was next-i18next.config.js,
that had duplicated languages in the locales value,
and fallbackLng with existing languages refer to existing languages.
This works for me,
rm -rf ./**/node_modules
while I need lerna bootstrap
This worked for me (on command line in Ubuntu):
Update Node using
sudo npm install -g n
followed by
sudo n 16.13.2
Closed and reopened shell, cd back into the correct repo and then
sudo install npm -g
Deleting package-lock.json or node_modules & After running:
npm install -g npm
it is working for me.

Error: EPERM: operation not permitted, unlink 'D:\Sources\**\node_modules\fsevents\node_modules\abbrev\package.json'

I just updated npm to 5.4.0.
Now, Whenever I want install a npm package I get the following error:
D:\Sources\DownloadCms\Md.Download\Web.Angular>npm install mds.angular.datetimepicker#latest --save
npm ERR! path D:\Sources\DownloadCms\Md.Download\Web.Angular\node_modules\fsevents\node_modules\abbrev\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\Sources\DownloadCms\Md.Download\Web.Angular\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, unlink 'D:\Sources\DownloadCms\Md.Download\Web.Angular\node_modules\fsevents\node_modules\abbrev\package.jso
n'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'D:\\Sources\\DownloadCms\\Md.Download\\Web.Angular\\node_modules\\fsevents\\node_modules\\ab
brev\\package.json\'\n at Error (native)',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'D:\\Sources\\DownloadCms\\Md.Download\\Web.Angular\\node_modules\\fsevents\\node_modules\\abbrev\\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mohammad\AppData\Roaming\npm-cache\_logs\2017-09-03T03_25_50_432Z-debug.log
I'm dead sure, run CMD as administrator.
Also I checked D:\Sources\DownloadCms\Md.Download\Web.Angular\node_modules\fsevents\node_modules\abbrev\package.json\, package.json is not exist in path !
Edit:
Upgrade to v5.4.1, still get the same error, even cannot work around with --no-optional :-(
I was able to fix this by running the command prompt/bash as admin and closing VSCode!
Seems like VSCode was locking some files.
Potentially something else could be locking these files for you.
It is an npm 5.4.0 issue https://github.com/npm/npm/issues/18287
Workarounds are
downgrade to 5.3
try running with --no-optional, i.e. npm install --no-optional
Please close all IDE like visual studio code. run npm install command through node.js command prompt.
Enjoy !
If you downgrade to 5.3 and still get the same error in Windows like me.
After hours working with npm versions I found the following solution:
1. Download latest recommended version of nodejs, these days is node-v6.11.3-x64
2. Uninstall nodejs with it.
3. Go to C:\Users\{YourUsername}\AppData\Roaming folder and delete npm and npm-cache folders
4. Run installer of nodejs again and install it
5 Update npm to 5.3 with npm i -g npm#5.3 command line
Now you should use npm without any issues.
I tried this solution found at a How to fix Node.js blog
just use
npm cache clean
in windows if it refuses use
npm cache clean --force
cache clean and npm update to latest with force work for me
npm cache clean --force
npm install -g npm#latest --force
I fixed by downgrading npm from 5.4.0 to version 5.3
npm i -g npm#5.3
I Hope this helps for you
I had the same problem on Windows.
The source of the problem is simple, it is access permission on folders and files.
In your project folder, you need
After cloning the project, change the properties of the folder and change the permissions of the user (give full access to the current user).
Remove the read-only option from the project folder.
(Steps 1 and 2 take a long time because they are replicated to the entire tree below).
Inside the project folder, reinstall the node (npm install reinstall -g)
Disable Antivirus. (optional)
Disable Firewall. (optional)
Restart PC.
Clear the npm cache (npm clear)
Install the dependencies of your project (npm install)
After that, error "Error: EPERM: operation not permitted, unlink" will no longer be displayed.
Remember to reactivate the firewall and antivirus if necessary.
I had the same issue and all I needed to do was login to npm
npm login
or alternatively
npm add user // consult the documentation for the params
For those who are coming from Windows OS, you just need to stop the development server and then execute your npm install ... command.
It is strange how Windows doesn't allow installing dependencies while server is running, but MacOS does allow.
If this doesn't work, then only go for the other options - clean cache, downgrade nodejs etc.
If all of the above failed to work for you, you might want to
restart your system
run command prompt as admin
run the npm command
In my case, the problem was that, I did not install typescript. Although I did install Node and Angular.
To check if you have installed typescript or not
Run this command: tsc -v
If not, then to install typescript
Run this command: npm install -g typescript
And, finally to install required dependencies
Run this command: npm install
in the root folder of the project.
---- Hope this helps someone ----
I had this logs in Windows.
I did the following
Close Visual Studio Code
Run Command Line as admin
Deleting package-lock.json fixed it for me.
I'm using VsCode and solved this issue by stopping the application server and them run npm install. There are files that were locked by the application server.
No need to close the IDE, just make sure there's no another process locking some files on your projects.
Mine was as a result of opening my project folder a 2 different terminals. I solved it by closing all running terminal (vs code was excluded) and executing the installation command again.
I hope this helps someone.
NB: deleting node_modules didn't solve it.
For me it worked in bash from git package
try:
C:\Program Files\Git\bin\bash.exe
then:
npm install mds.angular.datetimepicker#latest
There seems to be many solutions out there that worked with downgrading npm versions. For me, the solution was
npm install -force
I tried the downgrading of npm versions, modifying my npm prefix config to match the npm directory, and clearing cache. None of these worked, but apparently they worked for others, so it may be worth a shot.
For me on Windows the problem was too long path length. I moved the project to a smaller length path and it worked.
Deleting my node modules folder and running a normal npm install did it for me
For me it was Docker...
The moment that I closed the app container, I could do an npm install without any proble
P.S My node version is 14.15.5
I fixed this by removing the dist folder
--- Remove dist or public folder
the same error comes to me when i update the npm version to the latest 5.4
downgrade to the version 5.3.0 is useful.the error comes from the npm 5.4,you can check it in the issuses in npm 5.4
npm install npm#5.3 -g
Fixed in NPM 5.6.0
Upgrade to NPM 5.6.0 solved problem for me.
I wanted to run npm install from within my external hard drive as this is where i saved my code workspace. Windows 10 OS.
But I was getting the same error as the original post.None of the previous answers worked for me, I tried all of them:
uninstalling nodejs then re-installing
uninstalling nodejs then downgrading/installing a lower version of nodejs.
npm install -force
deleting the folders from C:\Users{YourUsername}\AppData\Roaming ... npm and npm-cache then re-installing.
npm cache clean --force
npm cache clean
npm install --g or npm install --global
What worked for me was this:
copy the folder from C:\Program Files\nodejs to D:\Program Files\nodejs
Then go to Control Panel\System and Security\System
Advanced System Settings
Environment Variables
System Variables
Double click Path
Add a new path
D:\Program Files\nodejs
Click ok
restart PC.
try npm install from within D: Drive
npm cache verify solved my issue.
I was doing: ng new my-app
and I faced similar error
I have
node version: 10.16.0
npm v 6.9.0
After trying everything, including node/npm upgrade, cache cleaning and reverting code, nothing helped besides one simple thing: Turning OFF Windows 10's Real-time protection during the dev/build. Looks like latest updates made it super aggressive.
npm login is required before publish
For windows,
Download latest recommended version of nodejs, these days is node-v6.11.3-x64
Uninstall nodejs with it.
Go to C:\Users\{YourUsername}\AppData\Roaming folder and delete npm and npm-cache folders
Run installer of nodejs again and install it
By default npm 3.10.10 should be installed along with node-v6.11.3-x64.
It worked for me with npm 3.10.10 but did not work with 5.3.X.
Also it did not worked with higher versions of node (above
node-v6.11.3-x64)
My problem was executing the command (npm audit fix all). I solved it when closing VSCODE and re-executed the command without problems.