Closed jan-molak closed 7 years ago
Yes, i noticed this as well (only on linux). It only occurs if there already a symlink to a different location. Probably you have a dependency in both your parent and child module.
I will fix it, logging it in info i think would be best.
It's fixed with this commit: https://github.com/nicojs/node-link-parent-bin/commit/020a7e94a4a486aaa75a284600d0c9b5b5a1a38c
I've released v0.1.3 for it. Let me know if you have any more problems!
Great stuff, thanks @nicojs! I'll check on Monday 👍
@nicojs This issue can be reproduced on Windows Linux Subsystem(Ubuntu). link-parent-bin v1.0.0
@Aqours thanks for your response.
Could you please show what the error is exactly? I'm getting this log message when using WSL (indicating the desired behavior works):
08:20:00 (64) INFO link Different link at 'packages/wct-runner/node_modules/.bin/_mocha' already exists. Leaving it alone, the package is probably already installed in the child package.
15:23:26 (315) INFO ParentBinLinker Linking dependencies ["@babel/cli","@babel/core","@babel/preset-env","@types/chai","@types/clipboard","@types/core-js","@types/event-hooks-webpack-plugin","@types/events","@types/gulp","@types/karma","@types/lodash","@types/md5","@types/mocha","@types/node","@types/sinon","@types/terser-webpack-plugin","@types/url-parse","@types/webpack","@types/webpack-bundle-analyzer","@types/webpack-dev-server","ansi-colors","autoprefixer","babel-loader","babelify","browserify","browserify-derequire","browserify-versionify","chai","css-loader","cssnano","del","event-hooks-webpack-plugin","file-loader","git-rev-sync","gulp","gulp-cli","gulp-header","gulp-rename","gulp-sourcemaps","gulp-uglify","http-server","karma","karma-chrome-launcher","karma-mocha","karma-mocha-reporter","karma-typescript","lerna","less","less-loader","link-parent-bin","mocha","postcss-loader","rimraf","rollup","shell-env","sinon","style-loader","terser-webpack-plugin","ts-loader","ts-node","tslint","typescript","url-loader","vinyl-buffer","vinyl-source-stream","watchify","webpack","webpack-bundle-analyzer","webpack-cli","webpack-dev-server","worker-loader"] under children ["adv-danmaku","danmaku","danmaku-live","danmaku-websocket","flv.js","screenshot"]
15:23:34 (315) ERROR ParentBinLinker Could not link bin babel for child adv-danmaku. { [Error: EEXIST: file already exists, symlink '../../../../node_modules/@babel/cli/bin/babel.js' -> '/mnt/c/VCS/bilibili/js-common/packages/adv-danmaku/node_modules/.bin/babel']
errno: -17,
code: 'EEXIST',
syscall: 'symlink',
path: '../../../../node_modules/@babel/cli/bin/babel.js',
dest:
'/mnt/c/VCS/bilibili/js-common/packages/adv-danmaku/node_modules/.bin/babel' }
15:23:34 (315) ERROR ParentBinLinker Could not link bin babel for child danmaku-websocket. { [Error: EEXIST: file already exists, symlink '../../../../node_modules/@babel/cli/bin/babel.js' -> '/mnt/c/VCS/bilibili/js-common/packages/danmaku-websocket/node_modules/.bin/babel']
errno: -17,
code: 'EEXIST',
syscall: 'symlink',
path: '../../../../node_modules/@babel/cli/bin/babel.js',
dest:
'/mnt/c/VCS/bilibili/js-common/packages/danmaku-websocket/node_modules/.bin/babel' }
15:23:34 (315) ERROR ParentBinLinker Could not link bin babel for child screenshot. { [Error: EEXIST: file already exists, symlink '../../../../node_modules/@babel/cli/bin/babel.js' -> '/mnt/c/VCS/bilibili/js-common/packages/screenshot/node_modules/.bin/babel']
errno: -17,
code: 'EEXIST',
syscall: 'symlink',
path: '../../../../node_modules/@babel/cli/bin/babel.js',
dest:
'/mnt/c/VCS/bilibili/js-common/packages/screenshot/node_modules/.bin/babel' }
15:23:34 (315) ERROR ParentBinLinker Could not link bin babel for child danmaku-live. { [Error: EEXIST: file already exists, symlink '../../../../node_modules/@babel/cli/bin/babel.js' -> '/mnt/c/VCS/bilibili/js-common/packages/danmaku-live/node_modules/.bin/babel']
errno: -17,
code: 'EEXIST',
syscall: 'symlink',
path: '../../../../node_modules/@babel/cli/bin/babel.js',
dest:
'/mnt/c/VCS/bilibili/js-common/packages/danmaku-live/node_modules/.bin/babel' }
... // too many errors
It works fine when I run command in CMD/PowerShell.
Are you mix-and-matching WSL and PowerShell / CMD? I don't think link-parent-bin supports that. Other tools don't support that either, for example npm
itself.
I myself use a different directory for WSL vs PowerShell/CMD/GitBash. WSL2 even goes as far as running bash in an actual vm so I would expect it not to share the disk with windows itself.
I use WSL(without PS/CMD) to clone new project and npm install deps with run link-parent-bin, still report these errors.
I seems these errors are related to WSL, I use git-bash terminal later, it works great too. Thanks
@nicojs I still have this problem on Mac or CI(docker/Linux). Is there any way to ignore these errors?
It seems be related to local deps symlink.
// directory structure
root
packages/
projectA
package.json
node_modules/
projectA (local dependency which symlink to above)
This directory structure would cause those errors when I exec link-parent-bin. ref: local dependency
@Aqours in your example, what are you trying to do exactly? What is the link-parent-bin
command you're executing?
A small reproduction repo would be helpful. It can be a zip you attach to this issue.
Hey @nicojs and thanks for this great module :-)
It seems that
ParentBinLinker
unnecessarily complains if the symlink already exists. This makes people looking at the logs think that there's a problem while, in fact, everything is just fine:Would it be possible to ignore
EEXIST
?Thanks, Jan