• Resolved sheratsuki

    (@sheratsuki)


    All in post title described.

    i’m following this guide https://developer.woocommerce.com/extension-developer-guide/creating-your-first-extension/ to install woocommerce extension dev environment.

    i change current directory to my-extension found on woocommerce/tools/create-extension/myextension then i run 2 commands

    pnpm install <- this one is ok
    pnpm start gives me error

    > wp-scripts start
    sh: 1: wp-scripts: not found
    ?ELIFECYCLE? Command failed.
    ?WARN? Local package.json exists, but node_modules missing, did you mean to install?

    i tried to add all node_modules in .bashrc

    # added by sheratsuki
    export WP_WOOCOMMERCE="/var/www/html/wordpress2/wp-content/plugins/woocommerce/node_modules"
    export PATH="$WP_WOOCOMMERCE:$PATH"
    # WP_WOOCOMMERCE END
    
    # added by sheratsuki
    export WP_WOOCOMMERCE_PLUGINS="/var/www/html/wordpress2/wp-content/plugins/woocommerce/plugins/woocommerce-admin/node_modules"
    export PATH="$WP_WOOCOMMERCE_PLUGINS:$PATH"
    # WP_WOOCOMMERCE_PLUGINS END
    
    # added by sheratsuki
    export WP_WOOCOMMERCE_WEBPACK="/var/www/html/wordpress2/wp-content/plugins/woocommerce/node_modules/.pnpm/[email protected][email protected]/node_modules"
    export PATH="$WP_WOOCOMMERCE_WEBPACK:$PATH"
    # WP_WOOCOMMERCE_WEBPACK END
    
    # added by sheratsuki
    #export WP_WOOCOMMERCE_EXTRACTION_WEBPACK_PLUGIN="/var/www/html/wordpress2/wp-content/plugins/woocommerce-beta-tester/node_modules/@woocommerce"
    export WP_WOOCOMMERCE_EXTRACTION_WEBPACK_PLUGIN="/var/www/html/wordpress2/wp-content/plugins/woocommerce-beta-tester/node_modules"
    export PATH="WP_WOOCOMMERCE_EXTRACTION_WEBPACK_PLUGIN:$PATH"
    # WP_WOOCOMMERCE_EXTRACTION_WEBPACK_PLUGIN END
    
    # added by sheratsuki
    export WP_WOOCOMMERCE_SERVERJS="/var/www/html/wordpress2/wp-content/plugins/woocommerce/packages/js/components/node_modules/"
    export PATH="$WP_WOOCOMMERCE_SERVERJS:$PATH"
    # WP_WOOCOMMERCE_SERVERJS END
    
    # added by sheratsuki
    export WP_WOOCOMMERCE_WP_SCRIPT_NOT_FOUND="/var/www/html/wordpress2/wp-content/plugins/woocommerce/node_modules/.pnpm/node_modules/i"
    export PATH="$WP_WOOCOMMERCE_WP_SCRIPT_NOT_FOUND:$PATH"
    # WP_WOOCOMMERCE_WP_SCRIPT_NOT_FOUND END
    
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘woocommerce plugin dev cmd pnpm start give error wp-scripts: not found’ is closed to new replies.