Using YARN
Solved
LAMP
-
@girish said in Using YARN:
yarn --version
Sorry for the late reply, it indeed does, however, when using custom commands, that are specified within your
package.json
file, it doesn't work.This is my package.json file:
{ "private": true, "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "@babel/core": "^7.18.13", "@babel/plugin-proposal-object-rest-spread": "^7.18.6", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-transform-runtime": "^7.18.10", "@babel/preset-env": "^7.18.10", "@tailwindcss/forms": "^0.5.2", "alpinejs": "^3.10.3", "apexcharts": "^3.35.5", "autoprefixer": "^10.4.8", "axios": "^0.27", "clockwork-browser": "^1.1.1", "cross-env": "^7.0.3", "laravel-echo": "^1.14.0", "laravel-vite-plugin": "^0.5.0", "lodash": "^4.17.21", "mix-tailwindcss": "^1.3.0", "object-path": ">=0.11.8", "postcss": "^8.4.16", "pusher-js": "^7.4.0", "resolve-url-loader": "^5.0.0", "sass": "^1.54.7", "sass-loader": "^13.0.2", "tailwindcss": "^3.1.8", "vite": "^3.0.2", "vue-template-compiler": "^2.7.10", "webpack": "^5.74.0", "webpack-cli": "^4.10.0" }, "dependencies": { "@alpinejs/mask": "^3.10.3", "@tailwindcss/aspect-ratio": "^0.4.0", "@tailwindcss/line-clamp": "^0.4.0" } }
When I run
yarn build
I get the following error.root@de780a18-b997-4803-a5b2-f07549cad279:/app/data/lectero# yarn build yarn run v1.22.17 warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable. warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0". $ vite build warning Cannot find a suitable global folder. Tried these: "/usr/local, /usr/local/share/.yarn" /bin/sh: 1: vite: not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
And I also think it has something to do with the version of Yarn not being version 2
-
-
Was just investigating this a bit. What I found is that yarn wants to write as root user into
/usr/local/share/.yarnrc
. This is reported upstream as bug https://github.com/yarnpkg/yarn/issues/4628Workaround (you can put this in /app/data/.bashrc if you like):
export YARN_DISABLE_SELF_UPDATE_CHECK="true"
After this, I am able to install easily:
root@38e05e7c-8aee-426e-85ef-a577d080c39c:/app/data/public# yarn add safetydance yarn add v1.22.17 warning package.json: No license field warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable. warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-0". warning No license field [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. warning No license field success Saved 1 new dependency. info Direct dependencies āā safetydance@2.2.0 info All dependencies āā safetydance@2.2.0 Done in 1.15s. root@38e05e7c-8aee-426e-85ef-a577d080c39c:/app/data/public#
-