nodelint icon indicating copy to clipboard operation
nodelint copied to clipboard

TypeError: Cannot assign to read only property 'string' of (begin)

Open kristianmandrup opened this issue 9 years ago • 24 comments

19:09 $ nodelint apps/_global/data
undefined:2557
        s.string = s;
                 ^

TypeError: Cannot assign to read only property 'string' of (begin)
    at ultimate (eval at <anonymous> (/Users/kristianmandrup/npm/lib/node_modules/nodelint/nodelint:46:11), <anonymous>:2557:18)
    at eval (eval at <anonymous> (/Users/kristianmandrup/npm/lib/node_modules/nodelint/nodelint:46:11), <anonymous>:3167:5)
    at eval (eval at <anonymous> (/Users/kristianmandrup/npm/lib/node_modules/nodelint/nodelint:46:11), <anonymous>:6399:2)
    at /Users/kristianmandrup/npm/lib/node_modules/nodelint/nodelint:46:3
    at Object.<anonymous> (/Users/kristianmandrup/npm/lib/node_modules/nodelint/nodelint:194:2)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
✘-1 ~/repos/test123/repo-manager-v3 [master|✚ 3…14] 
19:09 $ ls apps/_global/data
available feeds     forms     index.js  lists     menus

kristianmandrup avatar Sep 11 '15 17:09 kristianmandrup

Same issue here (OSX).

$ npm -v
2.14.2
$ node -v
v0.12.7

fauria avatar Oct 15 '15 14:10 fauria

Same here on ubuntu 15.04 vm

$ node --version; npm --version; uname -a; nodelint
v0.12.6
2.11.2
Linux g-virtual-machine-vivid 3.19.0-30-generic #34-Ubuntu SMP Fri Oct 2 22:08:41 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
undefined:2557
        s.string = s;
                 ^
TypeError: Cannot assign to read only property 'string' of (begin)
    at ultimate (eval at <anonymous> (/usr/local/lib/node_modules/nodelint/nodelint:46:11), <anonymous>:2557:18)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/nodelint/nodelint:46:11), <anonymous>:3167:5)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/nodelint/nodelint:46:11), <anonymous>:6399:2)
    at /usr/local/lib/node_modules/nodelint/nodelint:46:3
    at Object.<anonymous> (/usr/local/lib/node_modules/nodelint/nodelint:194:2)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)

This error seems to be happening because we are evaling /usr/local/lib/nodelint/jslint/jslint.js... s.string = s is on line 2557. ... Why are not requiring jslint as a normal dependency instead of evaling it?

gregory-nisbet avatar Nov 05 '15 23:11 gregory-nisbet

+1

tsoernes avatar Nov 08 '15 13:11 tsoernes

+1

m-vdb avatar Dec 18 '15 22:12 m-vdb

+1

felipap avatar Dec 20 '15 21:12 felipap

+1

node -v v4.0.0

npm -v 2.14.2

monsur avatar Dec 23 '15 03:12 monsur

FWIW I think the root issue is somewhere in JSLint (or some interplay with JSLint and Node). The line number 46 in the error is a red herring, since that line just evals JSLint.

monsur avatar Dec 23 '15 04:12 monsur

Vaporware at the moment.

brandonros avatar Jan 09 '16 04:01 brandonros

+1

PeterMK85 avatar Jan 16 '16 16:01 PeterMK85

+1

C:\Projects\pusher>jake build (node) child_process: options.customFds option is deprecated. Use options.stdio instead. evalmachine.:2557 s.string = s; ^ TypeError: Cannot assign to read only property 'string' of (begin) at ultimate (evalmachine.:2557:18) at evalmachine.:3167:5 at evalmachine.:6399:2 at Object.exports.runInContext (vm.js:44:17) at Object. (C:\Projects\pusher\node_modules\jslint\lib\nodelint.js:9:4) at Module._compile (module.js:397:26) at Object.Module._extensions..js (module.js:404:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) jake aborted. Error: !!! JSLint FAILED. !!! at api.fail (D:\Program Files\nodejs\node_modules\jake\lib\api.js:336:18) at ChildProcess. (C:\Projects\pusher\Jakefile.js:52:7) (See full trace by running task with --trace)

node -v 5.4.1

npm -v 3.5.3

jvopalensky avatar Jan 21 '16 00:01 jvopalensky

+1 node -v v4.2.6

npm -v 2.14.12

wickedest avatar Feb 09 '16 20:02 wickedest

I think this should be {{x.string = s;}} jslint.js:2557

wickedest avatar Feb 09 '16 20:02 wickedest

I'm having the same problem and have tested with both node v4 & npm v2 and node v5 & npm v3 combinations.

neka-io avatar Apr 06 '16 14:04 neka-io

+1

CutOffFrequency avatar Apr 27 '16 19:04 CutOffFrequency

Can you cut a new version of this npm module with this fix?

wickedest avatar Jun 03 '16 14:06 wickedest

Same here, OSX with Node 5.1.1

MaffooBristol avatar Jun 05 '16 11:06 MaffooBristol

Same here: Node: v4.4.5 nodelint: ^0.6.2

Windows 10 x64

markjohndoyle avatar Jun 06 '16 14:06 markjohndoyle

Same here...

npm v3.9.5 node v6.2.1

rantrix avatar Jun 21 '16 22:06 rantrix

same here npm v3.10.5 node v4.4.7

VOID404 avatar Jul 20 '16 08:07 VOID404

+1

npm 3.10.8 node v6.8.1

tofupup avatar Oct 17 '16 07:10 tofupup

+1 npm 4.1.2 node 7.5.0 macOS 10.12.3

starkovv avatar Feb 06 '17 20:02 starkovv

After about 5 minutes of poking around I just commented out the line producing the error, and everything seems to work just fine now. shrug

    function ultimate(s) {
        var x = symbol(s, 0);
        x.from = 1;
        x.thru = 1;
        x.line = 0;
        x.edge = 'edge';
        // s.string = s;
        return postscript(x);
    }

randomstring avatar Feb 28 '17 23:02 randomstring

Hey guys,

Sorry, this project hasn't been maintained in a long time 😞 While nodelint was great in the early days of Node.js, the world has moved on in terms of needing support for ES6+ syntax and we've not kept up.

Personally, I've been using ESLint for the last few years and it does a pretty decent job. There are also alternatives like JSHint if ESLint isn't to your liking for some reason.

Apologies for not making it clear that the project wasn't being maintained. I've now updated the repo info to mark that it's DEPRECATED.

A big thanks to those of you who did use it over the years though. Much appreciated!

— Cheers, tav

tav avatar Mar 01 '17 00:03 tav

Wesome, thanks for fair suggestions.

suculent avatar Apr 12 '17 18:04 suculent