serverless-plugin-typescript
serverless-plugin-typescript copied to clipboard
Error EPERM: operation not permitted, version 1.1.9
When I tried to run 'sls deploy', the following error is shown:
EPERM: operation not permitted, unlink '/Users/sofyan.ahmad/Projects/project-name/.build/node_modules'
The error is gone when I reverted back to version 1.1.7
I am unable to reproduce this one :disappointed: Are you using webpack? There's another issue surrounding webpack users at the moment which may be related.
Have you tried removing the .build and .serverless folders?
I have the same problem, on macOS as well.
Appending debug log here.
`SLS_DEBUG=* npx sls deploy --stage prod -v Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command create Serverless: Load command install Serverless: Load command package Serverless: Load command deploy Serverless: Load command deploy:function Serverless: Load command deploy:list Serverless: Load command deploy:list:functions Serverless: Load command invoke Serverless: Load command invoke:local Serverless: Load command info Serverless: Load command logs Serverless: Load command metrics Serverless: Load command print Serverless: Load command remove Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command slstats Serverless: Load command plugin Serverless: Load command plugin Serverless: Load command plugin:install Serverless: Load command plugin Serverless: Load command plugin:uninstall Serverless: Load command plugin Serverless: Load command plugin:list Serverless: Load command plugin Serverless: Load command plugin:search Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command login Serverless: Load command logout Serverless: Load command generate-event Serverless: Load command test Serverless: Load command dashboard Serverless: Invoke deploy Serverless: Invoke package Serverless: Invoke aws:common:validate Serverless: Invoke aws:common:cleanupTempDir Serverless: Compiling with Typescript... Serverless: Using local tsconfig.json Serverless: Typescript compiled.
Error --------------------------------------------------
EPERM: operation not permitted, unlink '/Users/up4/api/.build/node_modules'
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
Error: EPERM: operation not permitted, unlink '/Users/up4/api/.build/node_modules'
at Object.unlinkSync (fs.js:976:3)
at TypeScriptPlugin.
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com
Your Environment Information --------------------------- Operating System: darwin Node Version: 12.6.0 Serverless Version: 1.48.3 Enterprise Plugin Version: 1.3.2 Platform SDK Version: 2.1.0`
And reverting from 1.1.9 to 1.1.7 worked for me as well.
We are having to problem aswell... no WebPack and on Windows...
I honestly don't think serverless-plugin-typescript is to "blame" for this. I think something in the underlying fs-package messes up symlinks...
I've managed to fix this error by deleting the .build/.serverless/whatever directories and node-modules-directory... that solved the issue for me...
@ThomasEg I tend to agree, I've had a heap of issues getting symlink code to work across *nix and Windows. Windows doesn't allow symlinks without administrator level permissions (ref) and there are already a heap of flaky workarounds for exactly that problem (likely causing this issue).
Making matters worse is the fact that this plugin tries to support webpack configurations which change the expected output directory/file on top of TypeScript ones (aside: why do people feel they need to use this plugin in addition to webpack + ts-loader or similar?), I'm beginning to think that the scope of this plugin is far too large to be reasonably maintainable for just one person. Perhaps @divyenduz can weigh in here?
@JackCuthbert why do people feel they need to use this plugin in addition to webpack + ts-loader or similar?
I have, multiple times, tried to move away from this plugin to webpack, due to issues like this one... but i cannot get a satisfying result. Either i drown in strange runtime-errors i cannot track down or huuuuuuge compiletime...
Downgrading to v1.1.7 worked whilst v1.1.8 (and v1.1.9) errored.
I noticed that with v1.1.7, running sls package will create symlinks for the .build/node_modules directory.
Using v1.1.8 (or v1.1.9) it's no longer a symlink. Something in the v1.1.8 release broke this.
Same issue here. Downgrading to v1.1.7 worked...
folder permissions issue when building:
$ sudo rm -rf .build/
Downgraded to v1.1.7. What a miserable day for productivity this was.
Ensuring adequate permissions for local user on node-modules, .build, .serverless had not affect for me.
Downgraded to 1.1.7 too, working fine
Constantly having this issue, must remove the emit directory .build before deploying.
This usually happens upon build time exceptions, user interrupts during compilation also triggers this issue.
@vicary still having an issue
"deploy:dev": "rm -rf .build/ && sls deploy",
fixing when downgraded to v1.1.7
I'm getting
Error: ENOENT: no such file or directory, open '/my-project/.build/node_modules/.bin/json2yaml'
when I pin version 1.1.7
downgrading to 1.1.7 worked for me, deleting .build and .serverless didn't help
FWIW, my issue was that I needed to delete my .build folder before running the script.
Getting the same error, deleting .build and .serverless doesn't help. Any suggestions?
We had a similar issue in serveless-localstack repo which has a fix: https://github.com/localstack/serverless-localstack/issues/34
I had a local dependency like:
"dependencies:": {
"myLib": "file:../myLib",
"serverless-plugin-typescript": "^1.1.9"
}
The error EPERM: operation not permitted was present. I changed to 1.1.7 and the error was gone.
same w/ me. i have a local file linked to the app via package.json. reverting to 1.1.7 worked. i'm on a windows machine
Versions serverless cli: 1.59.3 typscript: 3.4.5
Getting this issue as well.
serverless-plugin-typescript 1.1.9 Typescript 3.7.3 Serverless CLI 1.59.3
My serverless-plugin-typescript version is 1.1.9 I got this issue, after changing my branches which are having different dependencies. Removed the .build folder and re run. Then it started working without any issue. So, I recommend everyone to first try deleting the .build folder, before downgrading to 1.1.7
Getting same error with "serverless-plugin-typescript": "^1.1.9" on my project. Using Windows 10 and Node 12.
UPDATE Maybe the fs.unlinkSync on this commit for v1.1.8 is causing the issue.
I recently published a new version from my forked repo on npm: @kingdarboja/serverless-plugin-typescript
Please test it as I merged several PRs from this repo in order to solve several issues, including this one.
Cheers!
I recently published a new version from my forked repo on npm: @kingdarboja/serverless-plugin-typescript
Please test it as I merged several PRs from this repo in order to solve several issues, including this one.
Cheers!
This is the only solution that worked for me, downgrade to 1.1.7 didn't work for me. (Ubuntu WSL)
Same here, 1.1.9 failed on the .build directory being present. Downgraded to 1.1.7 and it worked. serverless plugins installed:
serverless-plugin-typescriptserverless-offlineserverless-dotenv-plugin
Same issue as everyone else here:
- Packaging worked with
serverless-plugin-typescript1.1.7, but it included devdependencies which increased my bundle size way above the 250MB limit. - Packaging fails with 1.1.8 with this error:
Error: ENOENT: no such file or directory, open '[...]/.build/node_modules/[symlinked-module-name]'
Additional info: We're using Lerna for managing our packages and linking them.
Check @KingDarBoja 's fork at @kingdarboja/serverless-plugin-typescript.
One year after the bug reports this keeps happening.
Deleting .build and .serverless did the trick.