NPM PUG Error Generating HTML Files - "This is related to npm not being able to find a file"

233 Views Asked by At

I purchased an HTML5 template and the files need to be compiled with NodeJS. I have no experience with NodeJS and I'm running into errors. I'll provide everything I think is relevant but please let me know what other information might be helpful.

Here are my NodeJS results when running the install.bat: screenshot of npm results

Here is the install.bat:

@echo off
echo == Installing Intense ==
echo Step 1: installing [email protected] globally
call npm i [email protected] -g
echo Step 2: installing project packages
call npm i
echo Step 3: generating a public version of the site
call gulp build::dist
echo Step 4: generating projects for Novi builder
call gulp build::proj
echo Step 5: generating Novi Builder demo projects
call gulp build::demo
echo == Installation completed ==
pause

Here is the package.json:

{
  "name": "intense",
  "version": "4.15.0",
  "description": "Multipage site template",
  "main": "gulpfile.js",
  "scripts": {
    "express": "node server.js"
  },
  "author": "TemplateMonster",
  "license": "UNLICENSED",
  "devDependencies": {
    "connect-multiparty": "2.2.0",
    "oxyz-build": "1.2.2",
    "oxyz-express": "1.0.2",
    "html-minifier": "4.0.0",
    "html2json": "1.0.2",
    "pretty": "2.0.0"
  }
}

The gulpfile.js:

const
    path = require( 'path' ),
    glob = require( 'glob' ),
    gulp = require( 'gulp' );

let
    tmp = {},
    tasks = {};

glob.sync( './dev/*/build.config.js' ).forEach( function ( str ) {
    let
        siteName = path.parse( str ).dir.split( '/' ).pop(),
        siteTasks = require( str );

    for ( let key in siteTasks ) {
        if ( !tmp[ key ] ) tmp[ key ] = {};
        tmp[ key ][ siteName ] = siteTasks[ key ];
    }

    for ( let taskName in tmp ) {
        tasks[ `build::${taskName}` ] = gulp.series( Object.values( tmp[ taskName ] ) );
    }

    for ( let taskName in tmp ) {
        for ( let siteName in tmp[ taskName ] ) {
            tasks[ `build::${taskName}::${siteName}` ] = tmp[ taskName ][siteName];
        }
    }
});

module.exports = tasks;

The log file listed in the output is really long but it ends with this:

315 verbose stack Error: spawn bash ENOENT
5315 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
5315 verbose stack     at onErrorNT (node:internal/child_process:480:16)
5315 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:81:21)
5316 verbose pkgid [email protected]
5317 verbose cwd C:\Code\IntenseTheme\1519369-1609160745508_58888
5318 verbose Windows_NT 10.0.18363
5319 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
5320 verbose node v15.11.0
5321 verbose npm  v7.6.2
5322 error code ENOENT
5323 error syscall spawn bash
5324 error path C:\Code\IntenseTheme\1519369-1609160745508_58888\node_modules\node-sass
5325 error errno -4058
5326 error enoent spawn bash ENOENT
5327 error enoent This is related to npm not being able to find a file.
5328 verbose exit -4058

I have tried updating some of the packages I see in the warnings like this:

C:\Code\IntenseTheme\1519369-1609160745508_58888>npm install [email protected] -g

added 1 package, changed 14 packages, and audited 17 packages in 3s

found 0 vulnerabilities

C:\Code\IntenseTheme\1519369-1609160745508_58888>npm install [email protected] -g

added 2 packages, and audited 4 packages in 3s

found 0 vulnerabilities

C:\Code\IntenseTheme\1519369-1609160745508_58888>npm install [email protected] -g

added 2 packages, and audited 4 packages in 3s

found 0 vulnerabilities

But then when I try npm i again I get the exact same results as though nothing actually upgraded.

UPDATE:

Using NVM I switched to Node 14.15.5 and now I'm getting a new error on the second step: npm ERR! node-sass@4.14.1 install: node scripts/install.js npm ERR! Failed at the node-sass@4.14.1 install script.

Before I was able to use node-sass although I wish I noted which versions of everything I was using at the time (I'm learning.) However, now I get this error whenever I try to install any version of node-sass in any folder.

Here are my current versions: npm: '6.14.11', node: '14.15.5'

0

There are 0 best solutions below