Closed bxqgit closed 7 years ago
Hey,
that is not directly Phoenix related. Something with your nodejs/npm setup is broken. Your app will continue to work, you are just not able to compile your frontend assets right now.
@PhillippOhlandt Well, is it a common problem for Phoenix frontend assets? I'm pretty sure everything is fine with NodeJS/npm, because other products, that use them - work just fine.
It seems to be a common problem on Windows. When you google the error, you see a lot of issues on various NodeJS libs and frameworks. I am sure I had this problem too some day, but I can't remember how I fixed it. Maybe you can browse through the issues and look for a solution until someone else replies with one here.
@PhillippOhlandt
Looks like the problem is with brunch
npm package.
When I run:
npm install -g brunch
I get the same error.
That error generally means that a file is being accessed by two different things at 'around' the same time. And 90% of those times it is because of an anti-virus or similar.
@OvermindDL1 No antivirus at all. Microsoft protection apps are also turned off.
It looks like a filesystem permission issue. look here the same error
uninstall all npm modules and re-install with npm install --no-bin-links. I had same problem on windows. read this for more info
uninstall all npm modules and re-install with npm install --no-bin-links. I had same problem on windows. read this for more info
I'm curious, as I'm not a heavy windows user (only touch that mess at work), why is it working for me?
I stumble on the knowledge of --no-bin-links doing laravel projects on windows and always have problem with npm commands. So my rule of working on windows is "run npm with that switch" and on any other OS without it. If you have been using npm without the switch, then most likely you are yet to install a module that will fail doing so.
I stumble on the knowledge of --no-bin-links doing laravel projects on windows and always have problem with npm commands. So my rule of working on windows is "run npm with that switch" and on any other OS without it. If you have been using npm without the switch, then most likely you are yet to install a module that will fail doing so.
Do you have such a module that I can test with then? I use quite a load from brunch to bucklescript to many others and apparently over 700 (holy...) in between based on the dependency graph... >.>
@bxqgit have you made any progress on this? Did you try running npm install --no-bin-links
within the assets directory?
@chrismccord I just dropped the npm cache and everything works fine now. It's definitely the issue of npm, not Phoenix.
rd /s /q C:\Users\foo\AppData\Roaming\npm-cache
rd /s /q C:\Users\foo\AppData\Roaming\npm
Great to hear you're up and running! Thanks for following up
If you have private registries you forgot to configure, don't forget about npm adduser
or npm login
. Alternatively if that is the case, look over the ~/.npmrc
file to make sure this makes sense.
I was tracing this down thinking this was a perms issue or windows issue until I found this in another git issue.
Found this thread expiriencing similar issue with
npm publish <tarball>
Solved it by logging into npmjs:
npm login
Would be great to have more descriptive message for failed authentication, if this is the case.
We shoud off the Antivirus... Thank you OvermindDL1
We shoud off the Antivirus... Thank you
No problem. For note you shouldn't need to completely shut off the AV (well, for some of them, others still read everything, even ignored areas) if you just add the whole project path to it's ignored locations. :-)
Facing problem::while installaion of ionic... It shows python not installed.....could you help me to solve this
On 16 Jan 2018 9:10 pm, "OvermindDL1" notifications@github.com wrote:
We shoud off the Antivirus... Thank you
No problem. For note you shouldn't need to completely shut off the AV (well, for some of them, others still read everything, even ignored areas) if you just add the whole project path to it's ignored locations. :-)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix/issues/2464#issuecomment-358002533, or mute the thread https://github.com/notifications/unsubscribe-auth/AK-94WkRmKRWl5ptcKlDHTj0xwZw1ap1ks5tLMLhgaJpZM4PFFru .
Facing problem::while installaion of ionic... It shows python not installed.....could you help me to solve this
Elixir, nor Phoenix, use Python anywhere, so I'm unsure how it would relate to the phoenix repository. :-) No clue what ionic is, perhaps check its docs?
Thank you
On 16 Jan 2018 9:33 pm, "OvermindDL1" notifications@github.com wrote:
Facing problem::while installaion of ionic... It shows python not installed.....could you help me to solve this
Elixir, nor Phoenix, use Python anywhere, so I'm unsure how it would relate to the phoenix repository. :-) No clue what ionic is, perhaps check its docs?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix/issues/2464#issuecomment-358011496, or mute the thread https://github.com/notifications/unsubscribe-auth/AK-94ZR-SLOTAKwR0h3l50jKNX-F1XOBks5tLMhngaJpZM4PFFru .
If you are on windows you have to start your node application having adminsitration rights while opening your terminal (dos) window. Right click the terminal icon and select "run as an adminstrator"
Yes brother. Thank you
On 13 Feb 2018 6:59 pm, "kchrs" notifications@github.com wrote:
If you are on windows you have to start your node application having adminsitration rights while opening your terminal (dos) window. Right click the terminal icon and select "run as an adminstrator"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix/issues/2464#issuecomment-365266456, or mute the thread https://github.com/notifications/unsubscribe-auth/AK-94aGbu8HftdipCtQbdlszRhGhjjOjks5tUY4cgaJpZM4PFFru .
This worked for me: ctrl + Alt + Delete, Task Manager, Find all running instances of node server and kill them. install your packages.
basic idea is that your node server keeps running in the background even after you think you've closed it in the console and it is accessing all your node files.
Thank you
On 26 Feb 2018 10:13 pm, "Logan Simonsen" notifications@github.com wrote:
This worked for me: ctrl + Alt + Delete, Task Manager, Find all running instances of node server and kill them. install your packages.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix/issues/2464#issuecomment-368565759, or mute the thread https://github.com/notifications/unsubscribe-auth/AK-94b7fv3uCEM0PrtpdiN03u3NVzoL4ks5tYt8lgaJpZM4PFFru .
Thank you @LoganSimonsen . Your solution works for me
I had the same issue with create-react-app and chokidar. I had node running with npm start
in a different console, so after closing that the error went away. For me it was the same issue as @LoganSimonsen mentions.
Note: I'm used to Linux where this would not have been an issue, that's why I didn't catch it at first and it took me an embarrassing amount of time to find the problem.
I was facing the same issue. I moved my project in another folder and then tried running the same command. It worked. It indicates it is something in relation with permission.
@veton Thanks..You solved my problem!
It's ok brother. Do well
On Sun 22 Jul, 2018, 1:02 PM vidurajith-darshana, notifications@github.com wrote:
@veton https://github.com/veton Thanks..You solved my problem!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix/issues/2464#issuecomment-406847198, or mute the thread https://github.com/notifications/unsubscribe-auth/AK-94e8drCELUcHUaulajZvpdjE4ngeWks5uJCp1gaJpZM4PFFru .
Thank you @LoganSimonsen this working for me too
I tried using Task Manager to kill background node processes. For me I finally had to reboot to ensure that all background processes were killed.
KILL THEM ALL @schellack
I tried using Task Manager to kill background node processes. For me I finally had to reboot to ensure that all background processes were killed.
I too just ran into this for the first time trying to update my expo-cli npm install -g expo-cli
. I killed all the node processes in task manager to no avail (neither did stopping antivirus). Restarting windows did work.
command ran: expo init new_project_name expected: successful creation of project instead got the error below.
ERROR:
npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Godlove\Desktop\ReactNative\thirdReactApp\node_modules.staging\react-native-4cfe71f8\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testTextExample_1@2x.png' npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\Users\Godlove\Desktop\ReactNative\thirdReactApp\node_modules.staging\react-native-4cfe71f8\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testTextExample_1@2x.png'] npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\Godlove\Desktop\ReactNative\thirdReactApp\node_modules.staging\react-native-4cfe71f8\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testTextExample_1@2x.png' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: npm ERR! 'C:\Users\Godlove\Desktop\ReactNative\thirdReactApp\node_modules\.staging\react-native-4cfe71f8\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testTextExample_1@2x.png' }, npm ERR! stack: npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\Users\Godlove\Desktop\ReactNative\thirdReactApp\node_modules\.staging\react-native-4cfe71f8\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testTextExample_1@2x.png\'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: npm ERR! 'C:\Users\Godlove\Desktop\ReactNative\thirdReactApp\node_modules\.staging\react-native-4cfe71f8\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testTextExample_1@2x.png' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Godlove\AppData\Roaming\npm-cache_logs\2019-01-13T11_25_48_952Z-debug.log [03:25:49] Process exited with non-zero code: 4294963248 [03:25:49] Set EXPO_DEBUG=true in your env to view the stack trace.
have tried all the solutions above but none works for me, running windows 10. Please help. Thanks.
@Abilandou I don't think this is related to Phoenix, you should probably post it in here https://github.com/expo/expo
Ok thanks
Thanks @dalhorinek for the link, problem solved
uninstall all npm modules and re-install with npm install --no-bin-links. I had same problem on windows. read this for more info
Equally you can use npm ci --no-bin-link
where you'd use npm ci
otherwise. This worked in my case on Windows.
The solution above does not work for me. i have a sailsjs project and i tried to upload an image in to the assets/img folder but i get this Error: EPERM: operation not permitted, unlink './assets/img/'
error. I do not know what to do about this error.
@bbmattieu9 Might be best to ask this either on the elixir forums or on a node-specific area, but at the very least what is your OS? As long as it's not windows that error is simple to fix, if it is windows well thats more of node assuming unix'y style system and can have a huge variety of different causes, but shouldn't be a phoenix issue in either case.
To me was simple: I tried to run npm install
while npm run watch
was still running.
This worked for me: ctrl + Alt + Delete, Task Manager, Find all running instances of node server and kill them. install your packages.
basic idea is that your node server keeps running in the background even after you think you've closed it in the console and it is accessing all your node files.
If you use an IDE, kill running instances to.
Found this thread expiriencing similar issue with
npm publish <tarball>
Solved it by logging into npmjs:
npm login
Would be great to have more descriptive message for failed authentication, if this is the case.
@veton i have publish my pacakge and sometimes when install it for updates it causes this problem how can it be problem with publish ?
and if i use --no-bin-links
it's works
`Creating a new React app in C:\Users\CM\Downloads\react\github-profile. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...
npm ERR! path C:\Users\CM\AppData\Roaming\npm-cache_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806 npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall lstat npm ERR! Error: EPERM: operation not permitted, lstat 'C:\Users\CM\AppData\Roaming\npm-cache_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806' npm ERR! { [Error: EPERM: operation not permitted, lstat 'C:\Users\CM\AppData\Roaming\npm-cache_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806'] npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, lstat 'C:\Users\CM\AppData\Roaming\npm-cache_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'lstat', npm ERR! path: npm ERR! 'C:\Users\CM\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806' }, npm ERR! stack: npm ERR! 'Error: EPERM: operation not permitted, lstat \'C:\Users\CM\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806\'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'lstat', npm ERR! path: npm ERR! 'C:\Users\CM\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806', npm ERR! parent: 'postcss-image-set-function' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check thenpm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\CM\AppData\Roaming\npm-cache_logs\2019-03-22T10_27_19_722Z-debug.log
Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts has failed. Deleting generated file... node_modules Deleting generated file... package.json Deleting github-profile/ from C:\Users\CM\Downloads\reactDone.``
`
i was facing similar error but i tried to run create-react-app command many times and finally it was created , this was the problem with my internet connection. check your inernet connection
Thanks @dalhorinek for the link, problem solved
Please can you tell me how you solved this. I am having same issue. It will be a great help.
This worked for me: ctrl + Alt + Delete, Task Manager, Find all running instances of node server and kill them. install your packages.
basic idea is that your node server keeps running in the background even after you think you've closed it in the console and it is accessing all your node files.
Thanks a ton @LoganSimonsen . The idea worked for me.
That's great
On Thu 18 Apr, 2019, 11:27 AM Thulasi, notifications@github.com wrote:
This worked for me: ctrl + Alt + Delete, Task Manager, Find all running instances of node server and kill them. install your packages.
basic idea is that your node server keeps running in the background even after you think you've closed it in the console and it is accessing all your node files.
Thanks a ton @LoganSimonsen https://github.com/LoganSimonsen . The idea worked for me.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phoenixframework/phoenix/issues/2464#issuecomment-484366508, or mute the thread https://github.com/notifications/unsubscribe-auth/ACX33YICBHLX2DOTPYVWMQ3PRAEU7ANCNFSM4DYULLXA .
It could be simply due to the reason you had opened node_modules in file explorer.
That error generally means that a file is being accessed by two different things at 'around' the same time. And 90% of those times it is because of an anti-virus or similar.
Yep! It was because I had Webstorm open
Expected behavior
No errors while executing
npm install
in./assets
directory.Actual behavior
All commands are run as root/Administrator. I run
mix phx.new hello
, which suggests to runcd hello
andcd assets && npm install && node node_modules/brunch/bin/brunch build
afterwards.When I run
npm install
in./assets
directory, I get the following error:Is it ok? Does it break my app somehow?
Environment