I want to copy my node project from Windows to Mac (written in angular), how to do it?
I tried to copy the folder and run npm install, but it didn't work
Here is the error I am getting:
sh: /Users/pawelmeller/Documents/hotel/angular4/node_modules/.bin/napa:
Permission denied npm ERR!
code ELIFECYCLE npm ERR!
errno 126 npm ERR!
light-blue#3.8.0 install:
napa npm ERR!
Exit status 126 npm ERR!
npm ERR!
Failed at the light-blue#3.8.0 install script.
npm ERR!
This is probably not a problem with npm. There is likely additional logging output above.
It is probably one of three reasons
I don't see light-blue#3.8.0 (or any version) on the NPM registry. So it could be your internal registry causing a problem
If you need something installed globally, you might have to use sudo
Not all packages are 100% cross compatible - so check your dependencies
I can certainly tell you there is no problem copying projects from one to another. Node tends not to run with excess dependencies/libraries like other languages do. On PC you have to install a few other things but this is not the case on Mac.
Aside from all that, please make your answer less broad. You are not providing much context.
Related
I am trying to install GLOBALLY a package with npm from my home directory. After the install has completed, it indicates vulnerabilities. Upon trying to run npm audit fix, I obtain the following error.
npm ERR! code ENOLOCK npm ERR! audit This command requires an existing
lockfile. npm ERR! audit Try creating one first with: npm i
--package-lock-only npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file
I understand that the error asks me to run npm i --package-lock-only, but in which directory should I be creating this file? Running the command without specifying a path does not work. I have also tried to create the file in the directory where the package was installed, but that has also not solved the issue. Also, why isn't this file present to start with?
npm audit fix is intended to fix vulnerabilities with the dependencies of your own project. Projects do have a package-lock.json file.
It is not intended for globally installed packages. If there are vulnerabilities with packages from others, they need to be fixed by the package maintainer in a new release. You can then update to this new release.
BTW, you should not use globally installed packages. Use npx instead.
C:\Users\Jorge\Desktop\space-xplorer>npm install
node-sass#4.11.0 install C:\Users\Jorge\Desktop\space-xplorer\node_modules\node-sass
node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-72_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 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\Jorge\AppData\Roaming\npm-cache_logs\2020-01-23T22_44_17_513Z-debug.log
This issue is coming because of compatibility issue of node version and node sass version.
You need to downgrade node version to 10 to install node sass 4.1.0. It is not compatible with version 12 of node.
See this discussion for the same issue.
Compatible versions are listed on the readme https://github.com/sass/node-sass#supported-nodejs-versions-vary-by-release-please-consult-the-releases-page-below-is-a-quick-guide-for-minimium-support
Following 2 lines of code will resolve this error
npm run build
npm start
you should ask a question and provide some explanation, not just throw an error up and expect an answer. But I've seen this before:
Basically NPM is trying lacking a dependency for loading node-sass, and its fallback is to get the file it needs from github.
Looks like you're behind a firewall that blocks you from direct access to github, but all you actually need is that file bindings file.
You would have to have a proxy server that is allowed to access github, or download the binary file yourself.
I downgraded the node from 14.8 to 12.18.3, but it did NOT solve the problem.
but after that, as crazy as it is may sound, I deleted the package-lock.json and tried to install the package again and solved the problem.
I was trying to follow the tutorial on the react website today but for whatever reason it doesnt want to work for me when i run the command:
npx create-react-app my-app
`I get the following error message;
Creating a new React app in D:\NodeJs\react\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! code ETARGET
npm ERR! notarget No matching version found for postcss#^7.0.11
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'autoprefixer'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\matth\AppData\Roaming\npm-cache\_logs\2019-01-
12T17_55_39_805Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-
scripts has failed.
Deleting generated file... package.json
Deleting my-app/ from D:\NodeJs\react
Done.`
My npm version is 6.5.0 and Node is 11.6.0
Not sure what the heck is going on as when I did this on my work laptop it worked without any issues with the exact same versions of node and npm
I was fix problem when I error create-react-app
Err: code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
I had rename file .npmrc --> .npmrc-old
C:\Users\you\.npmrc
And I success >>> I feel perfect
-
Or can you fix:
--> use git bash terminal
Just an update for everyone. It worked now. All I did was reinstall nodejs for the 4th time, nothing else. Makes 0 sense. anyways, thanks for your answers, appreciate it.
I also got a same error.
Try to run npm cache clean --force after that just run create-react-app
Definitely It will work
I just created a new project using the "Basic Node.js Express 4 Application" template, and the project appears to already have errors:
Is this a bug in Visual Studio? How do I fix the errors?
Just Wait
When you create a new project using this template, Visual Studio runs npm install in the background to download packages and type information from the npm registry. Until that type information is downloaded, you may temporarily see errors in the editor.
Running npm install might take as long as 2 minutes depending on your network and disk conditions. If you don't yet see the npm command completed message, then npm is still running and you need to go grab a quick coffee. Once the install finishes, Visual Studio will automatically updated the Intellisense errors.
Waiting Didn't Work?
If you've waited a little and the errors are still there, the first step to diagnosing the problem is to check the Output window to see how the npm install is going. From the top menu, select View -> Output, then in the Output Window, select Npm in the combo box labeled Show output from:
What you do next depends on what you see in the output window.
Try Again
Due to a bug in the interaction between npm's staging behavior, graceful-fs, and the Win32 MoveFileEx API, npm install may randomly fail. You'll see an error trace in the Output Window that looks like this:
npm ERR! path C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json.2541088048
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json.2541088048' -> 'C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json'
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json.2541088048' -> 'C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json.2541088048' -> 'C:\Users\ryanca\source\repos\ExpressApp41\ExpressApp41\node_modules\#types\debug\package.json'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\ryanca\\source\\repos\\ExpressApp41\\ExpressApp41\\node_modules\\#types\\debug\\package.json.2541088048',
npm ERR! dest: 'C:\\Users\\ryanca\\source\\repos\\ExpressApp41\\ExpressApp41\\node_modules\\#types\\debug\\package.json' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename \'C:\\Users\\ryanca\\source\\repos\\ExpressApp41\\ExpressApp41\\node_modules\\#types\\debug\\package.json.2541088048\' -> \'C:\\Users\\ryanca\\source\\repos\\ExpressApp41\\ExpressApp41\\node_modules\\#types\\debug\\package.json\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\ryanca\\source\\repos\\ExpressApp41\\ExpressApp41\\node_modules\\#types\\debug\\package.json.2541088048',
npm ERR! dest: 'C:\\Users\\ryanca\\source\\repos\\ExpressApp41\\ExpressApp41\\node_modules\\#types\\debug\\package.json',
npm ERR! parent: 'express-app41' }
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\ryanca\AppData\Roaming\npm-cache\_logs\2018-03-28T16_48_13_111Z-debug.log
====npm command completed with exit code -4048====
DO NOT follow npm's suggestion to re-run the command as an Administrator; this will only make things worse. Run npm install from a regular commandline, or equivalently, select Install Missing npm Packages from the npm node in the Solution Explorer:
Note that this will run npm install, which may fail again (but probably won't).
Close the Solution
A small portion of users have seen npm install fail repeatedly. In the very unlikely event this fails again, you can try closing the solution, running npm install from the commandline, and re-opening the solution, but in general this should not be necessary. If npm install fails even with Visual Studio not running, then you likely have another problem, such as a corrupted npm cache, disk error, or some other npm bug not covered by this answer.
Consider Downgrading or Upgrading npm
The bug causing the EPERM errors was introduced in npm version 5, so if this is somehow causing serious problems for you, you can consider downgrading to any 4.x.x version. At time of writing the bug has not been fixed, but hopefully in the future a new version of npm with the graceful-fs bug fix will be released and you can simply upgrade.
NPM error on update. I recently update to Node version 7.x. Now npm is not working.
I am unable to locate the error, it may be due to -
npm ERR! Cannot find module 'internal/fs'.
I get the following when I run sudo npm update -g -
npm ERR! Linux 3.13.0-101-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "update" "-g"
npm ERR! node v7.1.0
npm ERR! npm v3.10.8
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/fs'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
My /etc/profile.d/nodejs.sh has the following contents:
NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
export NODE_PATH
You should be able to remove the npm directory (typically /usr/local/lib/node_modules/npm) and then reinstall one of the official node tarballs, which includes npm (you can find the latest from http://nodejs.org/dist/latest-v7.x/).
Did you upgrade from an older version of node?
If so, that is probably part of the reason why you are having this issue. Older versions of graceful-fs (a dependency of npm) did things that are no longer available in node v7.
According to this thread, updating npm to version 4 will solve your problem, try:
npm i -g npm#4
If this doesn't work, try:
~/.n/n/versions/node/7.0.0/bin/npm i -g npm#4
delete node_modules directory and then type in your console "npm install". For a reason that I dont know, if you only update npm, it does not fix the error, but re-installing npm everything is gonna be allright.
For me, if I facing error "cannot find module internal/fs", it would be refer to command path. Better find the command path:
npm config get prefix
put into system environment path.
It is worked for me after facing the error several days.