-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbolic Link fails on Windows #23
Comments
The "solution" is to copy the entire folder when symlink fails. Solution for serverless#23
You can use my fork like temporary solution for Winidows. In
|
@EugeneDraitsev solution worked like a charm, now I don't need to have a powershell administrative window opened. |
Will be nice if @schickling can take a look my pr and release this fix in next version of plugin |
Any updates about a permanent solution to this issue? |
I think everyone, who stacked with this problem should move from serverless-plugin-typescript
add plugin in
add const path = require('path');
const slsw = require('serverless-webpack');
module.exports = {
entry: slsw.lib.entries,
mode: 'development',
target: 'node',
resolve: {
extensions: [
'.js',
'.json',
'.ts',
'.tsx',
'.mjs',
],
},
output: {
libraryTarget: 'commonjs',
path: path.join(__dirname, '.webpack'),
filename: '[name].js',
},
module: {
rules: [
{
test: /\.ts(x?)$/,
use: [
{
loader: 'ts-loader',
},
],
},
{
type: 'javascript/auto',
test: /\.mjs$/,
use: []
},
],
},
}; And it's done. I hope you solve your serverless-typescript problem with this simple and nice workaround. |
Another option is to not use any plugin at all. In my last project I've done it that way and it worked like a charm (actually, the files watch through nodemon was faster). nodemon.js executes this on every file change: and tsconfig.json's outDir points to "dist". |
@didac-wh this is interesting, could you elaborate with more detail? |
@colthreepv Your serverless.yml function handlers should specify the file in the dist/ folder. e.g:
And this would be the nodemon.json file:
So nodemon only watches the files you are actually coding, not the compiled/transpiled ones, nor the third party modules, nor the ones generated by the serverless package. Let me know if I can help further. |
A fix for this has been released in version 1.1.7 🎉 Please re-open a new issue if you think this is still relevant 😄 |
There is a know problem on windows when the creation of symbolic links are need. The UAC filter the symbolic link permission and don't let the user use it. You must open the console as administrator to use this resource.
Steps to Reproduce:
Error:
PS C:\Jose\Dropbox\Github\AutoKariam> serverless invoke local -f hello
Serverless: Compiling with Typescript...
Using local tsconfig.json
Error --------------------------------------------------
EPERM: operation not permitted, symlink 'C:\Jose\Dropbox\Github\AutoKariam\node_modules' -> 'C:\Jose\Dropbox\Github\AutoKariam.
build\node_modules'
Stack Trace --------------------------------------------
Error: EPERM: operation not permitted, symlink 'C:\Jose\Dropbox\Github\AutoKariam\node_modules' -> 'C:\Jose\Dropbox\Github\AutoKariam.build\node_modules'
at Object.fs.symlinkSync (fs.js:961:18)
at ServerlessPlugin. (C:\Jose\Dropbox\Github\AutoKariam\node_modules\serverless-plugin-typescript\dist\src\index.js:80:20)
at Generator.next ()
at fulfilled (C:\Jose\Dropbox\Github\AutoKariam\node_modules\serverless-plugin-typescript\dist\src\index.js:4:58)
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
From previous event:
at PluginManager.invoke (C:\Users\José\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:217:22)
at PluginManager.run (C:\Users\José\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:236:17)
at variables.populateService.then (C:\Users\José\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:107:33)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
From previous event:
at Serverless.run (C:\Users\José\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:94:74)
at serverless.init.then (C:\Users\José\AppData\Roaming\npm\node_modules\serverless\bin\serverless:30:50)
Fonts:
https://github.com/jprichardson/node-fs-extra#windows
https://ember-cli.com/user-guide/#enabling-symlinks
Fonts for Solution:
https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy-sync.md
https://nodejs.org/api/fs.html#fs_fs_symlinksync_target_path_type
https://stackoverflow.com/questions/39106516/node-fs-copy-a-folder
The text was updated successfully, but these errors were encountered: