I installed Vapor in a brand new Laravel up. When I try to run 'vapor deploy production' I get this error:
Running Command: npm ci && npm run prod && rm -rf node_modules
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm#5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log
In Process.php line 254:
The command "npm ci && npm run prod && rm -rf node_modules" failed.
Exit Code: 1(General error)
Working directory: /home/vagrant/code/sales2/.vapor/build/app
Output:
================
Error Output:
================
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVers
ion >= 1. Run an install with npm#5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log
I sucessfully installed vapor. Created a new project and left the domain setting at default.
You didn't specify what your host operating system was, but I assume it's windows, when you ran "vagrant up" did you do so as administrator?
That said, this is an issue with npm and not Vapor. I'd running the "npm ci && npm run prod && rm -rf node_modules" command ssh'd into your vagrant console and troubleshoot from there.
You may not have configured the node package manager for this project. From your computer and not the homestead if you are using, run this command
<project directory>: npm install
This will create the necessary file.
Related
I'm using the latest macbook air laptop and trying to install browser-sync globally by this command "sudo npm install -g browser-sync" after install node.js and npm succesfully.
but after I tried this command, my terminal shows this error message again and again when I'm trying to install the package repeatly since I cannot find the browser-sync command.
could anyone help me solve this problem? thank you so much in advance!
I have tried to install this package since yesterday and really don't know how it will work. I checked the user/judy/node_modules folder and can find 3 browser-sync related folders, and tried to delete them but still failed to make the command work.
error message
(base) judy#judydeAir node_modules % sudo npm install -g browser-sync
Password:
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/browser-sync
npm ERR! dest /usr/local/lib/node_modules/.browser-sync-7ZQRhsQ1
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/usr/local/lib/node_modules/browser-sync' -> '/usr/local/lib/node_modules/.browser-sync-7ZQRhsQ1'
my path:
(base) judy#judydeAir node_modules % echo $PATH
/Users/judy/opt/anaconda3/bin:/Users/judy/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
failed to use browser-sync command:
(base) judy#judydeAir node_modules % browser-sync --version
zsh: command not found: browser-sync
i got this error when run command "npm install && npm run dev" on my project.
I have tried to run the command "npm install" and i get the other error.
enter image description here
You have to run:
npm install; npm run dev
The && operation in CLI only works in CMD on Windows. In Powershell you have to use a semicolon instead.
First try to update your nodejs version
npm install -g node
And then install cross-env globally
npm install --global cross-env
Finally install latest autoprefixer or 9.8.0 and run dev
npm install autoprefixer#9.8.0
npm install && run dev
The error you are getting is due to && operation in CLI, first of all, you have to install all dependencies using npm install and then you are allowed to run dev mode.
For real-time compiling you can use npm run watch instead of npm run dev.
Make sure you have installed node.js within your pc.
I am trying to deploy a Next.js application on heroku, but during project build it gives error "npm ERR! path /tmp/build_e888593abeb04bd0ba3c83c3147db89b/node_modules/websocket"
I found a solution that says to remove the .git folder from the node_modules/websocket directory. But there is not .git folder in the above mentioned directory.
npm ERR! path /tmp/build_e888593abeb04bd0ba3c83c3147db89b/node_modules/websocket
npm ERR! code EISGIT
npm ERR! git /tmp/build_e888593abeb04bd0ba3c83c3147db89b/node_modules/websocket: Appears to be a git repo or submodule.
npm ERR! git /tmp/build_e888593abeb04bd0ba3c83c3147db89b/node_modules/websocket
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.mTr1h/_logs/2019-05-08T16_02_03_118Z-debug.log
1) Run heroku run bash to get into a bash terminal where you would have access to your project’s files
2) Then rm -rf node_modules to completely delete the node_modules directory.
3) Exit bash.
4) Run heroku config:set NODE_MODULES_CACHE=false to ensure Heroku doesn’t try to use a cache in rebuilding your node_modules.
If this resolved it, you should set node_modules_cache back to true.
When i try to install cypress using this commnad:
sudo npm install cypress
or
sudo npm install -g cypress
It is giving me this error:
Error: EACCES: permission denied, open '/Users/humac/node_modules/cypress/cypress.zip'
Workaround: sudo npm install --unsafe-perm=true --allow-root cypress
In my case cypress had trouble accessing /root/.cache/Cypress upon npm install:
EACCES: permission denied, mkdir '/root/.cache/Cypress'
I found a relevant issue and ended up setting a custom cache dir:
export CYPRESS_CACHE_FOLDER=/app/.cache
npm install
Try using yarn package manager or downgrading npm to version 7.
For me it worked correctly.
I'm using Jenkins in an alpine linux container with node 16.
stage('Prepare-build') {
steps {
sh 'node --version'
sh 'npm --version'
sh 'ls -p'
sh 'git config --global --add safe.directory "*"'
sh 'yarn install'
}
}
The error I was getting is the following:
npm ERR! code 1
npm ERR! path /home/jenkins/agent/workspace/project/app/project-web-manager/node_modules/cypress
npm ERR! command failed
npm ERR! command sh /tmp/postinstall-716e113e.sh
npm ERR! Cypress cannot write to the cache directory due to file permissions
npm ERR!
npm ERR! See discussion and possible solutions at
npm ERR! https://github.com/cypress-io/cypress/issues/1281
npm ERR!
npm ERR! ----------
npm ERR!
npm ERR! Failed to access /root/.cache/Cypress:
npm ERR!
npm ERR! EACCES: permission denied, mkdir '/root/.cache/Cypress'
npm ERR!
npm ERR! ----------
npm ERR!
npm ERR! Platform: linux-x64 (Alpine Linux - 3.16.1)
npm ERR! Cypress Version: 10.6.0
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-08-18T17_09_27_887Z-debug-0.log
In my same case export the environment variable cypress cache folder did not work as expected, the error was even made mentioned above.
export CYPRESS_CACHE_FOLDER="/home/jenkins/agent/workspace/project/app/.cache"
After clearing my Cypress cache folder with cypress clear cache I ran into this issue as well.
This is what I did:
sudo rm -rf the Cypress folder in your .cache directory
For me I also deleted the Cypress folder in node_modules
Cleaned cache with npm cache clean --force
Installed Cypress with npm install cypress --save-dev
Hope this helps!
In my case I had issues running Cypress on Mac
An unexpected error occurred while verifying the Cypress executable.
----------
Error: EACCES: permission denied, open '/Users/me/Library/Caches/Cypress/9.7.0/binary_state.json'
----------
Platform: darwin-x64 (22.2.0)
Cypress Version: 9.7.0
The easiest think to do is to locate the folder within Finder app, and for both "Cypress" and "9.7.0" folder and adjust the permissions for "everyone" and "staff" to "Read & Write".
Note: You must click on the lock icon and use your mac admin/system password to change the permissions.
I just ran the command npm-check-updates -a and updated webpack to 4.1.1. I got the same error as everyone else at first:
The CLI moved into a separate package: webpack-cli. Please install
'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
However when I try to run npm install webpack-cli -D I get the following error:
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
Why does webpack require git to be installed?
If anyone else gets this error and just want to continue you can install the following program, make sure to enable windows command prompt during install.
https://git-scm.com/download/win