Skip to content

Instantly share code, notes, and snippets.

@deepak-cotocus
Last active February 29, 2024 07:40
Show Gist options
  • Save deepak-cotocus/0238d919153cb7dce1cd0bdda41e2973 to your computer and use it in GitHub Desktop.
Save deepak-cotocus/0238d919153cb7dce1cd0bdda41e2973 to your computer and use it in GitHub Desktop.

Revisions

  1. deepak-cotocus revised this gist Nov 10, 2020. No changes.
  2. deepak-cotocus revised this gist Nov 5, 2020. 1 changed file with 26 additions and 3 deletions.
    29 changes: 26 additions & 3 deletions cross-env-Permission-denied.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## Error:
    sh: 1: cross-env: Permission denied Ubuntu
    # sh: 1: cross-env: Permission denied Ubuntu

    ### Introduction:
    This is because of permission issues with global installation of packages, which npm is being denied access.
    @@ -34,11 +34,34 @@ root@ip-172-31-20-213:/opt/lampp/htdocs/mhn-admin-ms# npm run prod

    ```

    ![image](https://user-images.githubusercontent.com/62638864/93208032-87d1d280-f779-11ea-87e0-3495a070bc61.png)
    ![image](https://user-images.githubusercontent.com/62638864/98224434-7aff7d00-1f79-11eb-9721-c10251201094.png)

    #### Solution
    ## Worked for me
    `chmod -R a+x node_modules`

    `npm install [email protected] --save-dev`

    # First
    sudo chown -R $USER /usr/local

    And
    cd /path/of/project

    chmod -R a+x node_modules

    npm run watch

    # If not work
    npm rebuild

    npm run watch

    # If not work
    rm -Rf node_modules

    npm install

    npm run watch

    #### It worked for me....

  3. deepak-cotocus revised this gist Nov 5, 2020. 1 changed file with 26 additions and 18 deletions.
    44 changes: 26 additions & 18 deletions cross-env-Permission-denied.md
    Original file line number Diff line number Diff line change
    @@ -1,28 +1,36 @@
    ## Error:
    Vue packages version mismatch:

    - [email protected]
    - [email protected]
    sh: 1: cross-env: Permission denied Ubuntu

    ### Introduction:
    Though the version of the Vue-template-compiler is older than that of the Vue I just updated it to same version number as the Vue thus 2.6.11
    In your case the number might not be same as mine so replace the version which shows in your error.

    This is because of permission issues with global installation of packages, which npm is being denied access.
    I got this error in ubuntu machine while running a command `npm run prod`

    #### Error:

    ```php
    ERROR in ./resources/assets/js/components/ExampleComponent.vue
    Module build failed: Error:

    Vue packages version mismatch:

    - [email protected]
    - [email protected]

    This may cause things to work incorrectly. Make sure to use the same version for both.
    If you are using vue-loader@>=10.0, simply update vue-template-compiler.
    If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
    sh: 1: cross-env: Permission denied
    npm ERR! code ELIFECYCLE
    npm ERR! errno 126
    npm ERR! @ 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`
    npm ERR! Exit status 126
    npm ERR!
    npm ERR! Failed at the @ production script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/ubuntu/.npm/_logs/2020-11-05T09_35_05_202Z-debug.log
    npm ERR! code ELIFECYCLE
    npm ERR! errno 126
    npm ERR! @ prod: `npm run production`
    npm ERR! Exit status 126
    npm ERR!
    npm ERR! Failed at the @ prod script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/ubuntu/.npm/_logs/2020-11-05T09_35_05_222Z-debug.log
    root@ip-172-31-20-213:/opt/lampp/htdocs/mhn-admin-ms# chmod -R a+x node_modules
    root@ip-172-31-20-213:/opt/lampp/htdocs/mhn-admin-ms# npm run prod

    ```

  4. deepak-cotocus created this gist Nov 5, 2020.
    40 changes: 40 additions & 0 deletions cross-env-Permission-denied.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    ## Error:
    Vue packages version mismatch:

    - [email protected]
    - [email protected]

    ### Introduction:
    Though the version of the Vue-template-compiler is older than that of the Vue I just updated it to same version number as the Vue thus 2.6.11
    In your case the number might not be same as mine so replace the version which shows in your error.


    #### Error:

    ```php
    ERROR in ./resources/assets/js/components/ExampleComponent.vue
    Module build failed: Error:

    Vue packages version mismatch:

    - [email protected]
    - [email protected]

    This may cause things to work incorrectly. Make sure to use the same version for both.
    If you are using vue-loader@>=10.0, simply update vue-template-compiler.
    If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

    ```

    ![image](https://user-images.githubusercontent.com/62638864/93208032-87d1d280-f779-11ea-87e0-3495a070bc61.png)

    #### Solution

    `npm install [email protected] --save-dev`

    #### It worked for me....

    ## Then run `npm run prod` and check evrything will work fine.


    ## Thanks ##