Skip to content
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

wml writes to node_modules #31

Open
eqyiel opened this issue Jun 7, 2018 · 0 comments
Open

wml writes to node_modules #31

eqyiel opened this issue Jun 7, 2018 · 0 comments

Comments

@eqyiel
Copy link

eqyiel commented Jun 7, 2018

I noticed this because I'm using a package manager that enforces immutability:

~/sync/git/mango-chutney/steptember-app react-native-camera-update*
❯ wml add /Users/rkm/sync/git/mango-chutney/steptember-app/../react-native-camera node_modules/react-native-camera
? Source folder is a git repo, add `.git` to ignored folders? Yes
? Source folder is an npm package, add `node_modules` to ignored folders? Yes
(node:23530) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/nix/store/7bymhck9yazwcabmmxj7d9ihmfid4f6y-node-wml-0.0.83/lib/node_modules/wml/src/links.json'
    at Object.fs.openSync (fs.js:660:18)
    at Object.fs.writeFileSync (fs.js:1319:33)
    at Object.writeFileSync (/nix/store/7bymhck9yazwcabmmxj7d9ihmfid4f6y-node-wml-0.0.83/lib/node_modules/wml/node_modules/jsonfile/index.js:115:13)
    at Object.outputJsonSync (/nix/store/7bymhck9yazwcabmmxj7d9ihmfid4f6y-node-wml-0.0.83/lib/node_modules/wml/node_modules/fs-extra/lib/json/output-json-sync.js:13:12)
    at Object.module.exports.save (/nix/store/7bymhck9yazwcabmmxj7d9ihmfid4f6y-node-wml-0.0.83/lib/node_modules/wml/src/links.js:23:5)
    at promptForIgnoredFolders.then (/nix/store/7bymhck9yazwcabmmxj7d9ihmfid4f6y-node-wml-0.0.83/lib/node_modules/wml/src/cli/add.js:111:9)
    at <anonymous>
(node:23530) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either
by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23530) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I can work around it by installing wml per-project and using $(npm bin)/wml, but it still feels kind of dirty because the content of node_modules isn't meant to change like that.

It might be good to use something like this or to write to a user-defined location like WML_TEMP_DIR="$(pwd)"; wml add ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant