1

I installed a fresh Laravel in my system, removed all nodejs and npm package and folders and reinstalled the latest version. I did all but so far I cant run the npm install and npm run dev too. Can you help me?

Follow package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "popper.js": "^1.12",
        "cross-env": "^5.1",
        "jquery": "^3.2",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.4",
        "vue": "^2.5.7"
    }
}

Follow print screen errors and images:

When run: npm install

..continue npm install

When run: npm run dev

3
  • I agree it seems like a permission problem. Did you clone using a regular user? Commented Mar 8, 2018 at 19:43
  • I used chmod 777 -R to folder 'zero' and used sudo npm install but happened the same way Commented Mar 8, 2018 at 19:53
  • You shouldn't sudo package managers. That's just asking for trouble. Most will warn you. Commented Mar 8, 2018 at 21:28

2 Answers 2

1

Try fixing your permissions with this command in the terminal

sudo chgrp -R www-data /var/www/html/zero 
sudo chmod -R 775 /var/www/html/zero/storage
Sign up to request clarification or add additional context in comments.

2 Comments

chgrp: cannot access 'chmod': No such file or directory chgrp: cannot access '775': No such file or directory
Ok sorry. Then run them separately
0

I found the problem, cross-env must have updated its paths, it has "cross-env/dist/bin" not "cross-env/bin/" in package.json. Thanks for help!!!!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.