Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nanogen -w doesn't work on windows #10

Open
VINT64 opened this issue Jun 25, 2018 · 5 comments
Open

Nanogen -w doesn't work on windows #10

VINT64 opened this issue Jun 25, 2018 · 5 comments
Assignees
Labels

Comments

@VINT64
Copy link

VINT64 commented Jun 25, 2018

I add a "watchmode": "nanogen -w" script to package.lock
When I write npm run watchmode in windows console it gives me next error:

Error: EPERM: operation not permitted, readlink 'D:\test\public\jsons' at Object.fs.readlinkSync (fs.js:967:18)
at checkDest (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:184:23)
at checkPaths (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:208:24)
at copyDirItem (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:133:24)
at fs.readdirSync.forEach.item (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:127:39)
at Array.forEach ()
at copyDir (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:127:23)
at mayCopyDir (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:117:10)
at onDir (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:108:12)
at getStats (D:\test\node_modules\fs-extra\lib\copy-sync\copy-sync.js:44:32)

I have /jsons folder in /assets. Normally with nanogen it's added to /public
But /public directory is empty at all. What is the reason?
UPD2 found a solution from this user: run command prompt in administrator mode. nanogen -w starts a server but after any changes it crashes with the same error.

@doug2k1 doug2k1 self-assigned this Jun 25, 2018
@doug2k1 doug2k1 added the bug label Jun 25, 2018
@doug2k1
Copy link
Owner

doug2k1 commented Jun 25, 2018

Hi! I can confirm the issue and will investigate.

Thanks for reporting!

@ivanmono
Copy link

ivanmono commented Aug 3, 2018

Any progress on this one? Thanks in advance!

@a3con
Copy link

a3con commented Dec 3, 2018

+1

@a3con
Copy link

a3con commented Dec 4, 2018

Hi,

(Win7)

I made some edits to the files (this is bad practice, but I needed it):
/lib/modules/build.js
/lib/modules/serve.js
/lib/utils/server.js

The problem with "operation not permitted" in /lib/modules/build.js -> fse.copySync(). Didn't dig deep ... Just used: await fse.copy()

const build = async (options = {}) => {
...
// copy assets folder
if (fse.existsSync(${srcPath}/assets)) {
await fse.copy(${srcPath}/assets, outputPath);
}
...

Changes in /lib/modules/serve.js:

...
//const debounce = require('lodash.debounce'); // ?
...

/**

  • Serve the site in watch mode
    */
    const serve = async (options, flags) => {
    ...
    chokidar.watch(srcPath, { ignoreInitial: true }).on(
    'all',
    //debounce(
    async () => {
    await build(options);
    log.info('Waiting for changes...');
    }
    //, 500)
    );
    };
    ...

Changes in /lib/utils/server.js:

Added to parameters: noCssInject: true. Без этого параметра перезагрузка работала через раз.

Without this parameter, the restart worked terribly.


It is better not to use it in your project. This is a one-time solution. Perhaps it will help solve the problem.

@doug2k1
Copy link
Owner

doug2k1 commented Dec 4, 2018

Thanks, @a3con! It will surely help solving the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants