workshopper / goingnative

A NodeSchool style workshopper for learning how to write native Node.js addons
MIT License
414 stars 54 forks source link

part two get `Could not verify: Error: EISDIR` #99

Open thyecust opened 3 years ago

thyecust commented 3 years ago

I get this error in part two but didn't find any difference between my code and solution

> goingnative verify myaddon
Could not verify: Error: EISDIR: illegal operation on a directory, open 'C:\Users\thy\Documents\node-native\~test-addon-faux.3166'

My code:

> ls .\myaddon\

    目录: C:\Users\thy\Documents\node-native\myaddon

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2021/8/24     19:54                node_modules
-a----         2021/8/24     20:08            217 binding.gyp
-a----         2021/8/24     20:32             86 index.js
-a----         2021/8/24     20:43              0 myaddon.cc
-a----         2021/8/24     20:00            269 package.json

index.js

const bindings = require('bindings')
var addon = bindings('myaddon')

addon.print()
thyecust commented 3 years ago

I can fix it by adding a path.join

function copyFauxAddon (mode, callback) {
  copy(path.join(__dirname, 'faux', 'myaddon.cc'), path.join(copyFauxTempDir, "myaddon.cc"), { overwrite: true }, function (err) {
    if (err) { return callback(err) }

    callback(null, true)
  })
}

It can be compiled but still can't be required by exercise.js. Do you have a plan to support windows and cmd?

thyecust commented 3 years ago

I have made some modification, you can see it in #100.

Now the verify result is

PS C:\Users\thy\Documents\goingnative\goingnative> node .\bin\goingnative verify myaddon1
 ✓ 

 package.json contains "gypfile": true

 ✓ 

 binding.gyp includes a "myaddon" target

 ✓ 
 binding.gyp includes "myaddon.cc" as a source file

 ✓ 

 binding.gyp includes a correct NAN include statement

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“-m”开关。
  myaddon.cc
  win_delay_load_hook.cc
    正在创建库 C:\Users\thy\Documents\goingnative\goingnative\~test-addon-faux.3782\build\Release\myaddon.lib 和对象 C:\Users\thy\Documents\goingnative\goingnative\
  ~test-addon-faux.3782\build\Release\myaddon.exp
  正在生成代码
  Previous IPDB not found, fall back to full compilation.
  All 69 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  已完成代码的生成
  myaddon.vcxproj -> C:\Users\thy\Documents\goingnative\goingnative\~test-addon-faux.3782\build\Release\\myaddon.node
C:\Users\thy\Documents\goingnative\goingnative\~test-addon-faux.3782\build\Release\myaddon
 ✗ 

 JavaScript code loads addon and invokes print() method
To https:

I'm looking forward to your detailed help.