From ac4e8e9b5444a3a9ac8d9a956c24ed0dedde79d7 Mon Sep 17 00:00:00 2001 From: Deimos Date: Fri, 5 Jul 2019 17:22:45 -0600 Subject: [PATCH] Prevent symlink creation in npm install Vagrant on Windows has issues with creating symlinks inside shared folders - it requires a permission that isn't granted to a user by default. This can be fixed by changing security policies, but for our purposes we don't need the symlinks anyway, and can run the tools manually like this, instead of using the .bin/ symlinks. --- salt/salt/nodejs.sls | 9 ++++++--- tildes/package.json | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/salt/salt/nodejs.sls b/salt/salt/nodejs.sls index bc9930a..b6ab35f 100644 --- a/salt/salt/nodejs.sls +++ b/salt/salt/nodejs.sls @@ -14,9 +14,12 @@ nodejs-pkgrepo: - refresh: True # Install the npm packages defined in package.json +# Uses the --no-bin-links option to prevent npm from creating symlinks in the .bin +# directory, which doesn't work inside Vagrant on Windows install-npm-packages: - npm.bootstrap: - - name: {{ app_dir }} - - user: {{ app_username }} + cmd.run: + - name: npm install --no-bin-links + - cwd: {{ app_dir }} + - runas: {{ app_username }} - require: - pkg: nodejs diff --git a/tildes/package.json b/tildes/package.json index 88df638..84c52e7 100644 --- a/tildes/package.json +++ b/tildes/package.json @@ -5,8 +5,8 @@ "license": "AGPL-3.0-or-later", "scripts": { "lint": "npm run lint:js ; npm run lint:scss", - "lint:js": "eslint static/js/", - "lint:scss": "stylelint scss/" + "lint:js": "node node_modules/eslint/bin/eslint.js static/js/", + "lint:scss": "node node_modules/stylelint/bin/stylelint.js scss/" }, "dependencies": {}, "devDependencies": {